Graphing values from nagios
Toto Capuccino
shoktai at gmail.com
Sun Jan 29 18:50:48 CET 2006
On Nagios 1.3
Well, i put the right location of nagiosgraph.conf both in show.cgi and
insert.pl.
My hosts.cfg has proceess_perf_data 1
nagios.cfg has process_performance_data=1
andservice_perfdata_command=process-service-perfdata
I have searched for a perfdata.log file but i dont have one.
I put debug mode to 5 and when i simply run insert.pl i dont get any ouptut.
Here's my map file :
# Service type: ping
# output:PING OK - Packet loss = 0%, RTA = 0.00 m
/output:PING.*?(\d+)%.+?([.\d]+)\sms/
and push @s, [ ping,
[ losspct, GAUGE, $1 ],
[ rta, GAUGE, $2/1000 ] ];
# Service type: unix-disk
# ouput:DISK OK - free space: / 12372 mB (77% inode=96%): /raid 882442 mB
(88% inode=91%):
# perfdata: /=12372mB;14417;15698;96;16019
/raid=882441mB;999780;999780;91;999780
/output:DISK/ and do {
my @_pct = /: (\/.*?) .*?(\d+)% inode=(\d+)%/g;
while ( my($_d,$_b,$_i) = splice @_pct,0,3 ) {
my @_s;
/perfdata:.*$_d=(\d+)\w*?;(\d+);(\d+);(\d+);(\d+)/;
push @s, [ $_d,
[ free, GAUGE, $1*1024**2 ],
[ user, GAUGE, $2*1024**2 ],
[ root, GAUGE, $3*1024**2 ],
[ max, GAUGE, $5*1024**2 ],
[ blockpct, GAUGE, $_b ],
[ inodepct, GAUGE, $_i ] ];
}
};
# Service type: unix-dns
# output:DNS OK - 0.008 seconds response time (test.test.1M IN
A192.169.0.47)
# perfdata:time=8260us;;;0
/output:DNS.*?([.0-9]+) sec/
and push @s, [ dns,
[ response, GAUGE, $1 ] ];
# Service type: unix-load
# output: OK - load average: 0.66, 0.70, 0.73
# perfdata:load1=0;15;30;0 load5=0;10;25;0 load15=0;5;20;0
/output:CPU Load ([.0-9]+) (10 min average) ([.0-9]+) (60 min average)
([.0-9]+) (1440 min average) /
and push @s, [ load,
[ avg1min, GAUGE, $1 ],
[ avg10min, GAUGE, $2 ],
[ avg60min, GAUGE, $3 ] ];
# Service type: unix-smtp
# output:SMTP OK - 0.187 sec. response time
/output:SMTP.*?([-.0-9]+) sec/
and push @s, [ smtp,
[ response, GAUGE, $1 ] ];
and here is the output in nagios web interface
- for ping--> PING OK - Packet loss = 0%, RTA = 1.09 ms
- for dns --> DNS OK: 0.240 seconds response time www.yahoo.comreturns
68.142.226.46,68.142.226.50,68.142.226.54,68.142.226.55,68.142.226.34,
68.142.226.37,68.142.226.42,68.142.226.43
- for CPU-Load--> CPU Load 0% (10 min average) 0% (60 min average) 1%
(1440 min average)
nagiosgraph.log gives
Sun Jan 29 18:47:21 2006 INSERT debug: Config
logfile:/usr/local/nagios/nagiosgraph/nagiosgraph.log
Sun Jan 29 18:47:21 2006 INSERT debug: Config
rrddir:/usr/local/nagios/nagiosgraph/rrd
Sun Jan 29 18:47:21 2006 INSERT debug: Config
mapfile:/usr/local/nagios/nagiosgraph/map
Sun Jan 29 18:47:21 2006 INSERT debug: Config rrdtool:/usr/bin/rrdtool
Sun Jan 29 18:47:21 2006 INSERT debug: perfdata:
1138556838\tnlamssv01\tCpu-load\tCPU Load 0% (10 min average) 0% (60 min
average) 0% (1440 min average)\t 10 min avg Load=0%;80;95;0;100 60 min avg
Load=0%;80;95;0;100 1440 min avg Load=0%;80;95;0;100
Sun Jan 29 18:47:21 2006 INSERT info: Input
lastcheck:1138556838\tnlamssv01\tCpu-load\tCPU Load 0% (10 min average) 0%
(60 min average) 0% (1440 min average)\t 10 min avg Load=0%;80;95;0;100 60
min avg Load=0%;80;95;0;100 1440 min avg Load=0%;80;95;0;100
Sun Jan 29 18:47:21 2006 INSERT info: Input hostname:
Sun Jan 29 18:47:21 2006 INSERT info: Input perfdata:
Sun Jan 29 18:47:21 2006 INSERT info: Input servicedescr:
Sun Jan 29 18:47:21 2006 INSERT info: Input output:
Sun Jan 29 18:47:21 2006 INSERT debug: Config
logfile:/usr/local/nagios/nagiosgraph/nagiosgraph.log
Sun Jan 29 18:47:21 2006 INSERT debug: Config
rrddir:/usr/local/nagios/nagiosgraph/rrd
Sun Jan 29 18:47:21 2006 INSERT debug: Config
mapfile:/usr/local/nagios/nagiosgraph/map
Sun Jan 29 18:47:21 2006 INSERT debug: Config rrdtool:/usr/bin/rrdtool
Sun Jan 29 18:47:21 2006 INSERT debug: perfdata:
1138556834\tfrparsv03\tPING\tPING OK - Packet loss = 0%, RTA = 166.40 ms\t
Sun Jan 29 18:47:21 2006 INSERT info: Input
lastcheck:1138556834\tfrparsv03\tPING\tPING OK - Packet loss = 0%, RTA =
166.40 ms\t
Sun Jan 29 18:47:21 2006 INSERT info: Input hostname:
Sun Jan 29 18:47:21 2006 INSERT info: Input perfdata:
Sun Jan 29 18:47:21 2006 INSERT info: Input servicedescr:
Sun Jan 29 18:47:21 2006 INSERT info: Input output:
Sun Jan 29 18:47:21 2006 INSERT debug: Config
logfile:/usr/local/nagios/nagiosgraph/nagiosgraph.log
Sun Jan 29 18:47:21 2006 INSERT debug: Config
rrddir:/usr/local/nagios/nagiosgraph/rrd
Sun Jan 29 18:47:21 2006 INSERT debug: Config
mapfile:/usr/local/nagios/nagiosgraph/map
Sun Jan 29 18:47:21 2006 INSERT debug: Config rrdtool:/usr/bin/rrdtool
Sun Jan 29 18:47:21 2006 INSERT debug: perfdata: 1138556840\tnlamssv01\tFREE
SPACE D\tD:\ - total: 123.24 Gb - used: 80.73 Gb (66%) - free 42.51 Gb
(34%)\t D:\ Used Space=80.73Gb;110.92;117.08;0.00;123.24
Sun Jan 29 18:47:21 2006 INSERT info: Input
lastcheck:1138556840\tnlamssv01\tFREE SPACE D\tD:\ - total: 123.24 Gb -
used: 80.73 Gb (66%) - free 42.51 Gb (34%)\t D:\ Used Space=80.73Gb
;110.92;117.08;0.00;123.24
un Jan 29 18:48:11 2006 INSERT debug: Config
logfile:/usr/local/nagios/nagiosgraph/nagiosgraph.log
Sun Jan 29 18:48:11 2006 INSERT debug: Config
rrddir:/usr/local/nagios/nagiosgraph/rrd
Sun Jan 29 18:48:11 2006 INSERT debug: Config
mapfile:/usr/local/nagios/nagiosgraph/map
Sun Jan 29 18:48:11 2006 INSERT debug: Config rrdtool:/usr/bin/rrdtool
Sun Jan 29 18:48:11 2006 INSERT debug: perfdata:
1138556885\tusminsv03\tSMTP\tSMTP OK - 0.419 sec. response time\ttime=
0.419194s;;;0.000000
Sun Jan 29 18:48:11 2006 INSERT info: Input
lastcheck:1138556885\tusminsv03\tSMTP\tSMTP OK - 0.419 sec. response
time\ttime=0.419194s;;;0.000000
Sun Jan 29 18:49:21 2006 INSERT debug: Config rrdtool:/usr/bin/rrdtool
Sun Jan 29 18:49:21 2006 INSERT debug: perfdata:
1138556953\tsacapsv01\tDNS\tDNS OK: 0.617 seconds response time
www.yahoo.com returns 68.142.226.55,68.142.226.32,68.142.226.42,
68.142.226.45,68.142.226.46,68.142.226.52,68.142.226.53,
68.142.226.54\ttime=0.617490s;;;0.000000
Sun Jan 29 18:49:21 2006 INSERT info: Input
lastcheck:1138556953\tsacapsv01\tDNS\tDNS OK: 0.617 seconds response time
www.yahoo.com returns 68.142.226.55,68.142.226.32,68.142.226.42,
68.142.226.45,68.142.226.46,68.142.226.52,68.142.226.53,
68.142.226.54\ttime=0.617490s;;;0.000000
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20060129/39e9d9b1/attachment.html>
More information about the Users
mailing list