This file is indexed.

/var/lib/pcp/testsuite/1225 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
#! /bin/sh
# PCP QA Test No. 1225
# checks pmwebd graphite archive scanning and graphite export functionality
# checks the new -J flag for archive to hostname canonicalization in the query results.
# checks pmwebd and pmrep report the same values for the same archive and timestamps
#
# Copyright (c) 2017 Red Hat.
#
seq=`basename $0`
echo "QA output created by $seq"

. ./common.webapi
. ./common.python

test -d "$PCP_SHARE_DIR/webapps/graphite" || \
	_notrun "graphite webapp is not installed"
which curl >/dev/null 2>&1 || _notrun "No curl binary installed"

$sudo rm -fr $tmp.dir
$sudo rm -f $tmp.*
rm -f $seq.full

signal=$PCP_BINADM_DIR/pmsignal
status=1	# failure is the default!
username=`id -u -n`

_cleanup()
{
    $sudo rm -fr $tmp.dir
    $sudo rm -f $tmp.*
    [ -z "$pid" ] || kill $pid
}
trap "_cleanup; exit \$status" 0 1 2 3 15

webport=44339   # not 44323, so system pmwebd is unaffected by test case
webargs="-U $username -p $webport"

_filter_curl_i()
{
    tr -d '\r' |                      # drop ^M from httpd results
    sed -e 's,^Date:.*$,Date: XXX,' |
    grep -v 'Connection:.*Alive'      # some microhttpd versions add this
}

echo;echo;echo "=== check pmwebd WITHOUT -J for NO hostname canonicalization ===" | tee -a $seq.full
$PCP_BINADM_DIR/pmwebd $webargs -p $webport -G -X -A archives -vvvvv -l $tmp.out &
pid=$!
_wait_for_pmwebd_logfile $tmp.out $webport
curl -s -S "http://localhost:$webport/graphite/metrics/find?query=pmiostat_mark.hinv.ncpu" | _filter_curl_i
kill $pid
sleep 1

echo;echo;echo "=== check pmwebd WITH -J for hostname canonicalization ===" | tee -a $seq.full
$PCP_BINADM_DIR/pmwebd $webargs -p $webport -J -G -X -A archives -vvvvv -l $tmp.out &
pid=$!
_wait_for_pmwebd_logfile $tmp.out $webport
# note: the hostname in the "pmiostat_mark" archive is "kilcunda"
curl -s -S "http://localhost:$webport/graphite/metrics/find?query=kilcunda.hinv.ncpu" | _filter_curl_i

# leave the above pmwebd running, we'll be using hostnames in queries. $pid is still valid

#
echo;echo;echo === Compare pmval, pmrep and pmwebd/graphite time series for same metric, same archive and time range ===
#
echo;echo;echo === pmval time series dump ===
pmval -w 12 -f 6 -i sda -A 1s -S '@Tue Dec  1 07:03:00 2015' -T '@Tue Dec  1 07:16:00 2015' \
-Z UTC -a archives/pmiostat_mark -t 60 disk.dev.read_bytes

echo;echo;echo === pmrep time series dump ===
pmrep -A 1s -S '@Tue Dec  1 07:03:00 2015' -T '@Tue Dec  1 07:16:00 2015' -P 6 -p -f%s \
-Z UTC -a archives/pmiostat_mark -t 60 -i sda disk.dev.read_bytes | \
awk '/N\/A/ {next} /^[0-9]/ {print $1, $2}'

# Note: graphite timestamps do not have enough resolution. They use the format HH:MM_yyyymmdd, which does
# not allow seconds to be specified!
#
echo;echo;echo === pmwebd/graphite time series dump ===
curl -s -S "http://localhost:$webport/graphite/render?format=json&target=kilcunda.disk.dev.read_bytes.sda\
&from=07:03_20151201&until=07:16_20151201&maxDataPoints=14" | _filter_curl_i | pmjson --pretty

echo;echo;echo === pmwebd/graphite time series dump for ._ metric ===
# fetch the _ bit too
curl -s -S "http://localhost:$webport/graphite/render?format=json&target=kilcunda._\
&from=07:03_20151120&until=07:16_20151222" | _filter_curl_i | pmjson --pretty

cat $tmp.out >> $seq.full
status=0
exit