Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've just done a bunch of Nagios installs. Now comes the time to test them. What I'd like to do first is just a quick sanity check to verify the install went correctly.

Is there a quick way to trigger a Nagios alert, with the default install, short of filling up the hard disk using dd or suchlike?

share|improve this question

4 Answers 4

up vote 2 down vote accepted

If it's just to test your alerts/escalations change the Critical threshold on (one of) your check(s) to something that will trigger a CRITICAL check result.

Alternatively use the check_dummy plugin (from the Nagios Plugins pack) and set it up to return a CRITICAL status, for example:

check_dummy!2

Other status codes you can return are:

0 - OK
1 - Warning
2 - Critical
3 - Unknown
share|improve this answer
    
That's exactly what I was looking for, thanks Kev man. –  Bryan Hunt Jul 24 '12 at 21:52
    
BOFH4EVR BOFH4EVR BOFH4EVR –  Bryan Hunt Jul 24 '12 at 21:54

Nagios (as shipped with the EPEL repository) comes with a sample configuration which monitors localhost out of the box, as soon as you service nagios start. If you've installed Nagios from EPEL on a RHEL (or clone) box, then it should already be giving you host and service status reports for localhost.

share|improve this answer

Just use iptables to block communication from your Nagios host to your target machine. Say you are looking at your web servers. Log on to one, and block port 80/443 traffic from you nagios box simulating an outage.

If localhost only, maybe remove the plugin or one of the plugin dependencies. Iptables may still help simulate a failure.

share|improve this answer

You can send a test notification/alert from the web UI, but that really only tests that the notification command is able to send email.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.