Nagios Setup -Macros ??

Marc Powell marc at ena.com
Fri Feb 1 05:49:10 CET 2008


On Jan 31, 2008, at 8:55 PM, sachin holikar wrote:

> Hi All,
>
>  I have installed Nagios 2.9 on RedHat Linux 4.0 recently. This took  
> a bit of time to configure. Anyways now I have my webaccess set up.  
> Now the main part if to add hosts/services to get their alerts.
> I have also tested it to receive an Email Alert when a service e.g.  
> HTTP is not running.
> My couple of questions are
>
> 1. I have seen on a official website that other forms of alerts are  
> also present like Pager/User Defined action apart from Email Alerts  
> Notifications. We are interested in these User Defined actions. Is  
> it that we can run a particular command or Script itself when any  
> such Alert is generated ?? If yes How do we do it?

Yes. The notification process is outlined in the docs at http://nagios.sourceforge.net/docs/2_0/notifications.html 
. Each contact (http://nagios.sourceforge.net/docs/2_0/xodtemplate.html#contact 
) specifies notification commands that will be executed when the  
notification criteria are met. Take a look at the command{} definition  
for a contact's service_notification_command that is working for you  
now. If you've figured out how to send e-mail notifications, you  
should have a pretty good idea of the process. The sample config files  
have example notify-by-email and notify-by-epager command you can look  
at but if you can craft some notification that works from the command  
line, nagios can use it to let you know there's a problem.

The FAQ also has references to alternate notification types - http://www.nagios.org/faqs/index.php?section_id=7&expand=false&showdesc=false

> I have heard that Nagios uses Macros for all these notifications. If  
> yes can we modify them ? How ?

The sample notification commands are a good start to see how they're  
used. The list of macros, and when you can use them are at http://nagios.sourceforge.net/docs/2_0/macros.html 
. User defined macros are not available with nagios-2.

> 2. Regading Email Alerts, can we alter the Format of these Email  
> Alerts Notifications?? How?

Yes, just edit your contact{}'s specified notification command{}  
definition. The command_line is the script that nagios will run to  
notify you. Most of the time it's just a straightforward echo or  
printf to /bin/mail.
>
> It would be great if some one can atleast guide us in a right  
> direction.
>
The documentation is always an excellent resource.

--
Marc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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