Email and Groupware

check_zmcontrol

Description:

This plugin is a bash script which checks if there are any stopped services in the Zimbra mail system. Rather it reports a warning or critical state, depends on the argument you feed it:
./check_zmcontrol -w ## for warning
./check_zmcontrol -c ## for critical

Note that the user running Nagios daemon or, most commonly in this case, the NRPE daemon, is “nagios”. But to execute Zimbra’s zmcontrol command you need to run it as “zimbra” user. In this script I run execute:

su -l zimbra -c “/opt/zimbra/bin/zmcontrol status”

This means that the nagios user executing this script will need to have the ability to switch users. I recommend executing this script with sudo and in the sudoers file you would have to append the permission:

nagios ALL=(ALL) NOPASSWD:/usr/local/nagios/libexec/

which gives the nagios user to execute any nagios plugins with root privileges, which will allow for the correct execution of the su command.

Feel free to contact me for any more details.

Current Version

1.0

Last Release Date

2013-11-14

Compatible With

  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios XI
  • Nagios Fusion
  • Nagios Reactor

Owner

License

GPL


Project Notes
This plugin is a bash script which checks if there are any stopped services in the Zimbra mail system. Rather it reports a warning or critical state, depends on the argument you feed it: ./check_zmcontrol -w ## for warning ./check_zmcontrol -c ## for critical Note that the user running Nagios daemon or, most commonly in this case, the NRPE daemon, is "nagios". But to execute Zimbra's zmcontrol command you need to run it as "zimbra" user. In this script I run execute: su -l zimbra -c "/opt/zimbra/bin/zmcontrol status" This means that the nagios user executing this script will need to have the ability to switch users. I recommend executing this script with sudo and in the sudoers file you would have to append the permission: nagios ALL=(ALL) NOPASSWD:/usr/local/nagios/libexec/ which gives the nagios user to execute any nagios plugins with root privileges, which will allow for the correct execution of the su command. Feel free to contact me for any more details.
Reviews (0) Add a Review
Project Stats
Rating
0 (0)
Favorites
0
Views
33,211