This file is indexed.

/var/lib/pcp/testsuite/1067 is in pcp-testsuite 4.0.1-1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
#!/bin/sh
# PCP QA Test No. 1067
# Exercise the zbxpcp Zabbix integration module.
#
# Copyright (c) 2015 Red Hat.
#

seq=`basename $0`
echo "QA output created by $seq"

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

which zabbix_agentd >/dev/null 2>&1 || \
	_notrun "No zabbix_agentd binary found"
test -f /etc/zabbix/zabbix_agentd.conf || \
	_notrun "No configuration for the Zabbix agent daemon"
grep -q zbxpcp /etc/zabbix/zabbix_agentd.conf || \
	_notrun "No configuration of the Zabbix agent PCP module"

status=1	# failure is the default!
need_control=false
need_derived=false
control=$PCP_PMDAS_DIR/sample/dynamic.indom
derived=/etc/zabbix/zbxpcp-derived-metrics.conf
$sudo rm -rf $tmp $tmp.* $seq.full

_cleanup()
{
    $need_control && _restore_config $control
    $need_derived && _restore_config $derived
    rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
if [ -f $control ]
then
    need_control=true
    _save_config $control
fi
if [ -f $derived ]
then
    need_derived=true
    _save_config $derived
fi

_filter_values()
{
    # expect lines like:
# pcp.sample.dodgey.control    [u|5]
# pcp.sample.dodgey.value[d1]  [u|35]
# pcp.sample.bad.novalues      [m|ZBX_NOTSUPPORTED] [No value available.]
    # d|u|s -> zabbix types;
    # m is error encodings -> allow through

    sed \
	-e 's/\[[dus]|.*\]$/VALUE/g' \
	-e '/sample\.scramble/d' \
    #end
}

# real QA test starts here
echo "== request specific values"

# verify values for single metrics/instances
zabbix_agentd -t pcp.sample.long.one
zabbix_agentd -t 'pcp.sample.long.bin[bin-100]'
zabbix_agentd -t pcp.sample.ulonglong.million
zabbix_agentd -t pcp.sample.float.hundred
zabbix_agentd -t pcp.sample.double.ten

# string metrics
zabbix_agentd -t pcp.sample.string.null
zabbix_agentd -t pcp.sample.string.hullo

# aggregate/event metrics
zabbix_agentd -t pcp.sample.aggregate.hullo
zabbix_agentd -t 'pcp.sample.event.records[fungus]'

# other error cases
zabbix_agentd -t pcp.sample.bad.nosupport
zabbix_agentd -t pcp.sample.bad.novalues

# verify enumeration of all metrics
echo "== enumerated names and filtered values"
$sudo rm -f $control	# control the dynamic indom
echo '1 one' >$tmp.indom
echo '2 two' >>$tmp.indom
$sudo cp $tmp.indom $control
zabbix_agentd -p | fgrep pcp.sample. | _filter_values

# derived metrics
echo "== check derived metric configuration"
echo mem.util.allcache = mem.util.cached + mem.util.slab | tee $tmp.derived
echo sample.derived.hundredten = sample.float.hundred + sample.double.ten | tee -a $tmp.derived
$sudo cp $tmp.derived $derived
zabbix_agentd -t pcp.mem.util.allcache | _filter_values
zabbix_agentd -t pcp.sample.derived.hundredten | _filter_values

$sudo rm -f $control $derived

# success, all done
status=0
exit