Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_supervisorctl
.1
2011-03-03
- Nagios 3.x
GPL
161928
File | Description |
---|---|
check_supervisorctl.sh | check_supervisorctl.sh The full script |
license.txt | GPL Version 3 License |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
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
#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