Nagios script request - nagiostats
Moderators: Developers, Moderators
Nagios script request - nagiostats
I see that nagios has an executable called nagiostats that will dump data into mrtg format - is it possible that this will provide nagios statistics we could graph in Cacti?
- nebj00la
- Cacti User
- Posts: 112
- Joined: Fri Feb 17, 2006 9:02 pm
- Location: Massachusetts, USA
- Contact:
Re: Nagios script request - nagiostats
I would also like to see this supported.knobdy wrote:I see that nagios has an executable called nagiostats that will dump data into mrtg format - is it possible that this will provide nagios statistics we could graph in Cacti?
Thanks,
nebj00la
nebj00la
Okay, here's what I've come up with. First, my Nagios and Cacti instances both sit on the same box, so the wrapper script that returns data from nagiostats is run locally. If your Nagios instance sits elsewhere, you'll have to retool this a bit.
To use, first place the attached script in your cacti scripts directory. Second, alter the following section of the script to fit your Nagios configuration:
Third, import the graph templates you wish to use. Finally, create new graphs on localhost and assign the just imported templates.
This is my first attempt at exporting, so please be gentle if this blows up . Don't hesitate with comments, questions, or suggestions.[/code]
To use, first place the attached script in your cacti scripts directory. Second, alter the following section of the script to fit your Nagios configuration:
Code: Select all
# nagios binary and configuration locations
my %nagiostat = ( 'bin' => '/usr/local/nagios/bin/nagiostats',
'cfg' => '/usr/local/nagios/etc/nagios.cfg');
This is my first attempt at exporting, so please be gentle if this blows up . Don't hesitate with comments, questions, or suggestions.[/code]
- Attachments
-
- nagiostats_parse.pl
- Wrapper for nagiostats written in Perl. Will return a subset of data based on the given command line argument. Please view the script for available options.
- (1.83 KiB) Downloaded 713 times
-
- cacti_graph_template_nagios_-_active_checks_5_min.xml
- Average active service and host checks run per 5 minutes.
- (11.32 KiB) Downloaded 401 times
-
- cacti_graph_template_nagios_-_cached_checks_5_min.xml
- Average checks that have been cached, per 5 min
- (11.39 KiB) Downloaded 497 times
-
- cacti_graph_template_nagios_-_external_command_buffers.xml
- External command buffer usage.
- (11.34 KiB) Downloaded 534 times
-
- cacti_graph_template_nagios_-_host_latency_and_execution_time.xml
- Host check latency and execution times.
- (11.42 KiB) Downloaded 547 times
few more..
- Attachments
-
- cacti_graph_template_nagios_-_hosts_summary.xml
- Host status summary.
- (16.46 KiB) Downloaded 388 times
-
- cacti_graph_template_nagios_-_service_check_latency_and_execution_time.xml
- Service check latency and execution times.
- (10.9 KiB) Downloaded 546 times
-
- cacti_graph_template_nagios_-_services_summary.xml
- Service status summary.
- (19.96 KiB) Downloaded 406 times
I installed all of this but no go... CMD partial error in the Cacti logs... So I did the following:Okay, here's what I've come up with. First, my Nagios and Cacti instances both sit on the same box, so the wrapper script that returns data from nagiostats is run locally. If your Nagios instance sits elsewhere, you'll have to retool this a bit.
To use, first place the attached script in your cacti scripts directory. Second, alter the following section of the script to fit your Nagios configuration:
- append the Data Input with /usr/bin/perl and still not working
- checked script runs OK via command line, script runs fine, results are expected.
Not sure where to go from this point....
Is there any more detail in the cacti log?sterpstra wrote:I installed all of this but no go... CMD partial error in the Cacti logs... So I did the following:Okay, here's what I've come up with. First, my Nagios and Cacti instances both sit on the same box, so the wrapper script that returns data from nagiostats is run locally. If your Nagios instance sits elsewhere, you'll have to retool this a bit.
To use, first place the attached script in your cacti scripts directory. Second, alter the following section of the script to fit your Nagios configuration:
- append the Data Input with /usr/bin/perl and still not working
- checked script runs OK via command line, script runs fine, results are expected.
Not sure where to go from this point....
I ran Cacti in Debug logging mode... Shows the full command with the same result, which is a "U" like it's processing the "Die" portion of the script. Run the script manually, no problems...
09/25/2008 11:20:05 AM - CMDPHP: Poller[0] Host[1] DS[1654] WARNING: Result from CMD not valid. Partial Result:
The source code contains:sterpstra wrote:I ran Cacti in Debug logging mode... Shows the full command with the same result, which is a "U" like it's processing the "Die" portion of the script. Run the script manually, no problems...
09/25/2008 11:20:05 AM - CMDPHP: Poller[0] Host[1] DS[1654] WARNING: Result from CMD not valid. Partial Result:
Code: Select all
cacti_log("Host[$host_id] DS[$data_source] WARNING: Result from CMD not valid. Partial Result: " . substr($output, 0, $strout), $print_data_to_stdout);
Who is online
Users browsing this forum: No registered users and 22 guests