How to create a contact using the web interface

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
baba20009
Posts: 2
Joined: Thu Dec 06, 2012 12:45 pm

How to create a contact using the web interface

Post by baba20009 »

I am new to Nagios. We have Nadios Core 3.2.3 setup by previous admin
Currently there are two contacts and a group contact.
I need to know the easiest way to add my email so I get monitoring alerts.
I cannot logon ad root in web interface (http://servername/nagios), but I can logon ad a user called Nagiosadmin but I only see “Configuration” View Config”.
I can logon as root only using the putty.
How can I use the web interface and copy one the current users and inherit all settings like service and host notification options then just modify the email to mine?
Also why can’t I logon as root in web interface?
Thanks
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: How to create a contact using the web interface

Post by jsmurphy »

Nagios by default uses a http passwd file, which is completely separate from the linux server authentication (hence root login won't work). Nagios is not configured via the default web interface, it's possible that the previous admin was using a plugin for web config management... though I know a lot of people don't.

The nagios configuration is flat file based and can be found in /usr/local/nagios/etc/ assuming that he didn't change around the default configuration architecture the file you are looking for is /usr/local/nagios/etc/contacts.cfg. You should be able to duplicate an existing contact definition, change the name and put your email address in. Once that is done, in the same file, change the contact-group so that the contacts line reads:

...
contacts old-user, new-user
...

Hopefully this helps!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: How to create a contact using the web interface

Post by slansing »

I'm going to piggyback on Jsmurphy's post, he is correct Nagios Core can not be modified in that way through the web interface, you may be thinking of Naigos XI our commercial product.
baba20009
Posts: 2
Joined: Thu Dec 06, 2012 12:45 pm

Re: How to create a contact using the web interface

Post by baba20009 »

I am currently reading on Nagios help Chapters.

Can you elaborate on how to modify the contact file, add to the group and have correct permission to receive alets.

Thanks
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: How to create a contact using the web interface

Post by jsmurphy »

You can modify the contacts file with any text editor, vim, nano, emacs, whatever takes your fancy. It sounds like you have already found this but just in-case this is the Nagios bible: http://nagios.sourceforge.net/docs/3_0/toc.html

Telling you exactly what you need to do is a bit hard considering I don't know what your contact file looks like, but I can give you the general idea. Assuming everything is in contacts.cfg:
1. Copy and paste the text of an existing contact (preferably the user you want it to be the same as).
2. Give that contact a new unique name and change the contact email address to whatever you want.
3. Find the contact group.
4. change the line in the contact group object that says "contacts" from "contacts olduser" to "contacts olduser, newuser" where olduser and newuser are the existing user and the user you created respectively.
5. Save the file
6. Verify the config: "/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg"
7. If there are no errors then do either "/etc/init.d/nagios restart" or "service nagios restart"

Nagios is a very flexible application it can be difficult to tell people exactly what to do because configuration structure can very greatly. Hopefully this helps you though.
Locked