Home Directory Plugins Software check_supervisorctl

Search Exchange

Search All Sites

Nagios Log Server Now Available - Download Now

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

check_supervisorctl

Bookmark and Share

Rating
0 votes
Favoured:
0
Current Version
.1
Last Release Date
2011-03-03
Compatible With
  • Nagios 3.x
E-mail
License
GPL
Hits
136184
Files:
FileDescription
check_supervisorctl.shcheck_supervisorctl.sh The full script
license.txtGPL Version 3 License
Checks supervisorctl for programs that are not in the state of RUNNING.
That is to say STOPPED, STARTING, BACKOFF, STOPPING, EXITED, FATAL, UNKNOWN

In my implementation requires SUDO to run supervisorctl.
To run: ./check_supervisorctl
Tested on CentOS 5.5 / RHEL 5

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#Intended For: Users that run supervisor & supervisorctl who want to monitor their programs / workers using Nagios.
#Required: supervisorctl, egrep, wc
#Quick Description: This script uses the supervisorctl program to check the status of all programs.
#Why?: Sometimes a program fails or doesn't start and you need to know about it.
If supervisord process is running, but the programs aren't, you will never be notified.
#Detailed Description: User supervisorctl, egrep, and wc to check for non-running programs. No command line parameters are required.
#What: Nagios check_supervisorctl.sh plugin

#Background: Our supervisor / supervisorctl daemons run as root. This may be different for your environment.

#Installation
1. EDIT: /usr/local/nagios/etc/commands.cfg.
ADD: command[check_supervisorctl]=sudo /usr/local/nagios/libexec/check_supervisorctl.sh

2. EDIT: sudoers /etc/sudoers
ADD: nagios ALL=(ALL) NOPASSWD:/usr/local/nagios/libexec/check_supervisorctl.sh
On CENTOS / RHEL comment out the line
"Defaults requiretty"
3. EDIT: Your host definition config file
ADD: Service definition
define service{
use generic-service
host_name HOSTNAME
service_description Supervisor Workers
check_command check_nrpe!check_supervisorctl
notifications_enabled 1
notification_period 24x7
notification_interval 30
contact_groups CONTACTGROUP
}

***Obviously change HOSTNAME and CONTACTGROUP to whatever your environment requires.

4. Change ownership
chown nagios:nagios /user/local/nagios/libexec/check_supervisorctl.sh

5. Change permissions
make check_supervisorctl.sh executable
chmod 744 /user/local/nagios/libexec/check_supervisorctl.sh