1

I am trying to setup Monit on an auto-scaled group of machines. Ideally I would like monit to send alerts to my nagios service (which is already configured to escalate alerts).

I have found this old post which asked for such a feature, but I cannot find any documentation that describes this. Is it possible to setup custom alerting in Monit?

Best regards

EDIT: I know I could write a bash script that sends passive checks to Nagios, and execute it with an exec command, but I would like to know if there is a cleaner solution, using the alert command.

Danduk82
  • 178
  • 1
  • 9

1 Answers1

2

From the monit docs, it seems that alert is strictly for sending email.

You can use email as a delivery method for Nagios checks by sending the alerts to an email address that gets piped to a script (rather than being delivered to a mailbox), like mail2mon. The script then submits a passive check to Nagios.

If that's not viable, there are a number of ways you can have Nagios poll for similar information. At a minimum, you could use check_file_age on the pid file, or check_logfiles to look for monit events in syslog.

Keith
  • 4,627
  • 14
  • 25
  • Thanks for the suggestions. I think I will probably use the check_logfiles approach, as I already use rsyslog. I think I will use Monit to write to a local log file if there are problems, and forward this to Nagios instance. – Danduk82 Oct 28 '15 at 07:56