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.
Nagiosgraph regular expression issues - map file
-
- Posts: 7
- Joined: Mon Nov 03, 2014 6:21 am
Re: Nagiosgraph regular expression issues - map file
This plugin should already return performance data. What version of the plugin are you using?storkie2010 wrote:but I'm only interested in the output.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
- Posts: 7
- Joined: Mon Nov 03, 2014 6:21 am
Re: Nagiosgraph regular expression issues - map file
It returns some perf data, but it doesn't have the information i want to graph.
I'm using version 1.59 - the latest version.
Thanks
I'm using version 1.59 - the latest version.
Thanks
Re: Nagiosgraph regular expression issues - map file
If it is outputting all that data are status information and not perfdata information (the data displayed after the | character) then you may need to write a wrapper script that will mirror the regular status information as properly-formatted perfdata information.
Former Nagios employee