Linux Interfaces

nagios_commander

Description:

A simple bash wrapper for the largely undocumented Nagios API which can access all common front-end operations.

Current Version

1.0

Last Release Date

2012-10-06

Compatible With

  • Nagios 3.x

License

Apache


Project Files
Project Photos
Project Notes
The little known Nagios front-end API, which can be accessed via curl, is actually quite powerful if only it were more accessible. This project aims to wrap this functionality around a simple command line interface to query and command a Nagios instance as one would using the GUI. Nearly all basic functions of Nagios are working out of the box. Please comment and report bugs here or at github as they arise (and they always do ;). Biggest thanks to my employer, Big Fish Games Inc., for allowing me to open source this project having learned everything I now know about Nagios at the time of this release. The help dialog shown below should suffice until a more detailed doc on usage surfaces: -n | --nag-host nagios HOSTNAME followed by its nagios directory -u | --username USER to execute commands -p | --password PASSWORD of the executing user -q | --query QUERY a nagios or device in nagios list (object or group object required) host_downtime service_downtime notifications (global) event_handlers (global) active_svc_checks (global) passive_svc_checks (global) active_host_checks (global) passive_host_checks (global) -c | --command COMMAND to issue in the form --command [action] [scope] [value] action: set del ack scope: (required for all but ack) downtime notifications event_handlers active_svc_checks passive_svc_checks active_host_checks passive_host_checks value: (only required for global commands) enable disable -Q | --quiet Flag for QUICK execution and QUIET output -h | --host HOST to execute the METHOD against. Leave blank to query all hosts. -H | --hostgroup HOSTGROUP to execute the METHOD against. -H followed by nothing for listing all. -s | --service_name SERVICE as execution object. -S | --servicegroup SERVICEGROUP an execution object. Follow with nothing to list all. -t | --time TIME in minutes to place on a downtime window, beginning now -C COMMENT (required by set downtime, ack) -* print this help dialog Usage: nagios_commander.sh -n -c -h -H -s -S -t -c Examples: ./nagios_commander.sh -n nagios.sea.bigfishgames.com/nagios -c set downtime -h cfengine01.sea -s PROC_CFAGENT_QUIET -t 1 -C 'downtime comment' -Q ./nagios_commander.sh -n nagios.sea.bigfishgames.com/nagios -q list -h -u -p ./nagios_commander.sh -n nagios.sea.bigfishgames.com/nagios -q host_downtime -u -p
Reviews (1) Add a Review
HTTPS
by estebanmonge, October 31, 2012

How can you use https?



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
5 (1)
Favorites
0
Views
66,701