[poll] host notification command

let’s say my e-mail address is [email protected], how would I get nagios to send me an e-mail notifying me that a service/host is malfunctioning. I don’t understand how it works so if anyone can explain how I would do that or link me to some documentation I’d truly appreciate it. :slight_smile:

Nagios comes with documentation that does an excellent job of explaining how to install and configure it. It is available via the web interface, and also at nagios.org/docs/ . A couple other good links are:

installing under debian: wiki.tryphon.org/How_to_install_ … der_Debian

main documentation supplement:
klickitat.ee.washington.edu/medg … -notes.txt

general install guide
nagios.sourceforge.net/docs/2_0/installing.html

freebsd install guide:
section6.net/wiki/index.php/ … in_FreeBSD

I’ve also included a text file with ALL my nagios bookmarks (these included)

You’ve also probably found the 2nd greatest resource besides the documentation. This forum is great, but remember RTFM first, as it usually has the answers to your questions. good luck!

[file=e107_files/public/6820_nagiosnotes.txt]6820_nagiosnotes.txt[/file]

i must admit that the first time i had some problems getting on nagios because the installation had been made by somebody else… and some permissions were missing… :stuck_out_tongue:
Then i made the whole lot from scratch and it took me around two weeks to have as i wanted it… that doesn’t mean you need 2 weeks to have it running… much depends from your workload. if you have plenty of time and resources i think it can be done wqithout toio much effort in a couple of days. 1 day reading 1 day playing around :slight_smile:

Luca

After you have read the docs on how to configure hosts.cfg services.cfg hostgroups.cfg contacts.cfg contactgroups.cfg if you still don’t understand how to get an email, then reply again, and I"m sure someone can help. Gotta give it the college try first ok?

hey man, I’ve read the docs, I just have a little problem understanding all those $ signs, macros and stuff. I don’t know whether they are built in or I have to write the code for them? My deadline is next friday, so I’ll see what I can do over the weekend in terms of college lol.

To get notified about a problem you have to be a user first off.
Define a user per the docs. Add that user “tech” to the contact.cfg file. Give him 24/7 timeperiod.
Define a service check and a host for that service. Put that host in a hostrgroup called “tech_servers”.
define a contact group called “techs” in the contactgroups.cfg file. Put that user in this group as a member.
In the service defintion for the service, tell it the contact_group is “techs”.
Restart nagios
Now, click on the service and click on “Enable notifications for this service”.
Down the service in some method and see if you are getting an email. If not, let us know the errors.

You don’t have to define any macros, or rewrite nagios. That’s been done already, so don’t worry about the $ stuff at this point.

So as you can see, if a service fails, nagios will contact whatever you have in the services.cfg for “contact_groups”, in this case “techs”.
Since in the contactgroups.cfg you have defined a contactgroup called “techs” and “tech” is a a member as shown in that file, then “tech” will be notified.
Lastly since you defined a “contact_name” in the contacts.cfg called “tech” and his “service_notification_period” is 24/7, he/she will be notified and life is good.

Edited Fri Jul 22 2005, 09:00AM ]

a little clarification on two things, 1) This user I’m supposed to create would b 4 the web interface, kinda like nagiosadmin?
2)in defining a service check what do I put for the check_command and wouldn’t that check command have to be defined in checkcommands.cfg and if so what would the command_line be?

now for what I really don’t understand. What would I put as e-mail in the contacts.cfg file. now that I think about it maybe it’s unnecessary

Edited Wed Jul 27 2005, 02:18PM ]

I can’t tell you what to define for a check_command. ONly you can decide that. Perhaps, check_coka-cola to see if the vending machine is out of coka-cola. There is almost nothing nagios can’t check, so you decide what you want to check.
The user’s you create can be defined in the contacts.cfg so that they may view certain hosts/services and be notified if a failure occurs. The email that you use surely wouldn’t be your email, so use your best judgement. If you are defining a contact for your boss, what email do you think you would define for your boss? Surely not my email addy, or your email addy.