Nagiosgraph regular expression issues - map file
Posted: Fri Dec 05, 2014 5:09 am
I am trying to setup some basic graphs for our Windows server disk usage. The Nagios plugin check_wmi_plus.pl returns information in both Nagios output and performance data - but I'm only interested in the output. Examples below of full info from perfdata.log.
1417703665||UCSEEREP01||Disk C: Capacity||OK - C: Total=31.90GB, Used=21.81GB (68.4%), Free=10.09GB (31.6%)||'C: Space'=21.81GB; 'C: Utilisation'=68.4%;
1417771470||QLXTS1||Disk C: Capacity||WARNING - [Triggered by _FreeGB<5] - C: Total=33.88GB, Used=30.44GB (89.9%), Free=3.44GB (10.1%)||'C: Space'=30.44GB; 'C: Utilisation'=89.9%;
Here's what I have in my map file (note: I have deleted all other specific checks);
/output:([A-Z]): Total=([\d.])GB, Used=([\d.])GB [\d().\%], Free=([\d.])GB [\d().\%]*/
and push @s, [ 'disk',
[ 'Total_Gb', GAUGE, $3 ],
[ 'Used_Gb', GAUGE, $4 ],
[ 'Free_Gb', GAUGE, $5 ] ];
I have tested my regex via the excellent tool http://www.regexplanet.com/advanced/perl/index.html and its correctly picking out the data into array elements;
$array[0]=C
$array[1]=31.90
$array[2]=21.81
$array[3]=10.09
$array[0]=C
$array[1]=33.88
$array[2]=30.44
$array[3]=3.44
I've tried many different variations of my regex, RRD database namd and key names but am just going round in circles!
Any help would be hugely appreciated.
I don't particularly want to tweak my wmi plugin to export the data in perfdata as it should be possible to get this working from command output.
1417703665||UCSEEREP01||Disk C: Capacity||OK - C: Total=31.90GB, Used=21.81GB (68.4%), Free=10.09GB (31.6%)||'C: Space'=21.81GB; 'C: Utilisation'=68.4%;
1417771470||QLXTS1||Disk C: Capacity||WARNING - [Triggered by _FreeGB<5] - C: Total=33.88GB, Used=30.44GB (89.9%), Free=3.44GB (10.1%)||'C: Space'=30.44GB; 'C: Utilisation'=89.9%;
Here's what I have in my map file (note: I have deleted all other specific checks);
/output:([A-Z]): Total=([\d.])GB, Used=([\d.])GB [\d().\%], Free=([\d.])GB [\d().\%]*/
and push @s, [ 'disk',
[ 'Total_Gb', GAUGE, $3 ],
[ 'Used_Gb', GAUGE, $4 ],
[ 'Free_Gb', GAUGE, $5 ] ];
I have tested my regex via the excellent tool http://www.regexplanet.com/advanced/perl/index.html and its correctly picking out the data into array elements;
$array[0]=C
$array[1]=31.90
$array[2]=21.81
$array[3]=10.09
$array[0]=C
$array[1]=33.88
$array[2]=30.44
$array[3]=3.44
I've tried many different variations of my regex, RRD database namd and key names but am just going round in circles!
Any help would be hugely appreciated.
I don't particularly want to tweak my wmi plugin to export the data in perfdata as it should be possible to get this working from command output.