As promised the example.
This example creates a graph that shows active memory usage for a Windows System. The script uses the Nagios/NetSaint plugins to interrogate the Nagios/NetSaint agent installed on the Windows System.
1. I want to view Committted and Available Memory, this means that I will have to create a multiple outplut script
2. The perl script that will interrogate the Windows Performance Counter
Code:
#!/usr/bin/perl
$avail = `/usr/lib/nagios/plugins/check_nt -H $ARGV[0] -p 20000 -v COUNTER -l “\\Memory\\Available Bytes”`;
chomp $avail;
$commit = `/usr/lib/nagios/plugins/check_nt -H $ARGV[0] -p 20000 -v COUNTER -l “\\Memory\\Committed Bytes”`;
chomp $commit;
print “commit:$commit avail:$avail\n”;
3. The Data Input Method in Cacti: See attached file ‘DataInputMethod.jpg”
– The “Input String” field is equal to:
“perl
4. The Data Source Template: See attached File “DataSource.jpg”
– The Data source Item “Mem_Commit” uses the output field “commit – Committed Memory”
5. The Graph Template: See attached File “Graph.jpg”
6. You can now add a Polling Host and use the graph template.
Hope this helps,
Kwabbernoot
DataInputMethod.jpg
Description:
Data Input
Filesize: 75.52 KB
Viewed: 5999 Time(s)
DataInputMethod.jpg
DataSource.jpg
Description:
Data Source Template
Filesize: 141.91 KB
Viewed: 5999 Time(s)
DataSource.jpg
Graph.jpg
Description:
Graph Template
Filesize: 210.02 KB
Viewed: 5999 Time(s)
Graph.jpg