send a test page

Greg King wgking at shaw.ca
Mon Sep 26 00:46:37 CEST 2005


> From: Rossella Mariotti-Jones [mailto:rossella at chemeketa.edu]
> Sent: Friday, September 23, 2005 12:33 PM
> To: nagios-users at lists.sourceforge.net;
> nagiosplug-help at lists.sourceforge.net
> Subject: [Nagios-users] send a test page
> 
> 
> 
> Hi all, does anybody how to send test pages to pagers from within 
> Nagios? I refuse to think that the only way to do it is setup a test 
> group and unplug
> a box, there's gotta be another way! Thanks in advance.
> 
> 
Here is a manual way the test any command, as follows:

1. log into nagios web interface as an admin, and "View config", commands. 
2. Find the command you want to test, and select all the code, and right click "copy" 3. ssh into the nagios server. Log in with the id that Nagios runs as, or issue "su - <nagios-id>" command after login as root. 
4. enter command "vi testcmd.sh", go to insert mode and paste command to be tested. Remove all trailing "$" from the Nagios macros, and save command. Removing these training $ is only necessary for email or pager ids but it pretties up the test results (they will have trailing $ if you don't which will be ok for most things, except for email ids or pager #). 
5. Set environment variables for each of the Nagios macros - ie SERVICEDESC=Myservice, NOTIFICATIONTYPE=Alert, etc. 
6. >chmod +x testcmd.sh
7. >. testcmd.sh  - this will run the command as Nagios would. Be sure to source the command to keep environment variables (ie >source testcmd.sh or >. testcmd.sh)

While this is not strictly "within Nagios" I have used it a few times to debug flakey Nagios commands.

Good luck!

Regards, Greg



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list