Page 1 of 1

Nagios install not successful

Posted: Mon Apr 11, 2011 1:33 am
by jwoon
Hi,

I am using fedora 14 in a vm. Questions.

1) Has anyone tried installing it successfully on fedora 14? Is there an updated documentation?
I keep on having issues with the message below. I can see the file and it is in rw-rw-rw mode though. Why is it complaining? I even changed it to 777.

"Error: Cannot open main configuration file '/usr/nagios/etc/nagios.cfg' for reading!
Error processing main config file!

2) Does the nagios install package that comes with fedora 14 really works? Again, any updated documentation?

A note for the developers, please try to update the documents accordingly. I believe there should be sufficient money flying around for nagios so far. Sorry if I am wrong.

Appreciate your help. Thanks. :roll:

Re: Nagios install not successful

Posted: Mon Apr 11, 2011 2:51 am
by jwoon
I got the following error message when I try to do this below.

Any idea why? Is there a simple template that works? Thanks.

nagios -v nagios.cfg

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/etc/nagios/objects/commands.cfg'...
Processing object config file '/etc/nagios/objects/contacts.cfg'...
Processing object config file '/etc/nagios/objects/timeperiods.cfg'...
Processing object config file '/etc/nagios/objects/templates.cfg'...
Processing object config file '/etc/nagios/objects/localhost.cfg'...
Error: Could not find any contact matching 'nagiosgroup' (config file '/etc/nagios/objects/contacts.cfg', starting on line 51)
Error: Could not expand member contacts specified in contactgroup (config file '/etc/nagios/objects/contacts.cfg', starting on line 51)
Error processing object config files!

Re: Nagios install not successful

Posted: Mon Apr 11, 2011 3:03 am
by jwoon
If I ignore the above and try to proceed, it gives me an error message. Further below are my steps. Can you verify those highlighted words?

[root@localhost nagios]# service nagios start
Starting nagios:CONFIG ERROR! Start aborted. Check your Nagios configuration.

Steps taken during installation.

yum install httpd php

yum install gcc glibc glibc-common

yum install gd gd-devel

1) Create Account Information

Become the root user.

su -l


Create a new nagios user account and give it a password.

/usr/sbin/useradd -m nagios

passwd nagios


Create a new nagcmd group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group.

/usr/sbin/groupadd nagcmd

/usr/sbin/usermod -a -G nagcmd nagios

/usr/sbin/usermod -a -G nagcmd apache

2) Download Nagios and the Plugins

Create a directory for storing the downloads.

mkdir ~/downloads

cd ~/downloads

3) Compile and Install Nagios (IS THE LOGIN ROOT or NAGIOS??)

Extract the Nagios source code tarball.

cd ~/downloads

tar xzf nagios-3.2.3.tar.gz

cd nagios-3.2.3


Run the Nagios configure script, passing the name of the group you created earlier like so:

./configure --with-command-group=nagcmd (I AM USING ROOT TO DO THIS since there is no asking me to get back to nagios user id??)


Compile the Nagios source code.

make all


Install binaries, init script, sample config files and set permissions on the external command directory.

make install

make install-init

make install-config

make install-commandmode


Don't start Nagios yet - there's still more that needs to be done...

4) Customize Configuration

Sample configuration files have now been installed in the /usr/local/nagios/etc directory. These sample files should work fine for getting started with Nagios. You'll need to make just one change before you proceed...

Edit the /usr/local/nagios/etc/objects/contacts.cfg config file with your favorite editor and change the email address associated with the nagiosadmin contact definition to the address you'd like to use for receiving alerts.

vi /usr/local/nagios/etc/objects/contacts.cfg (SOMETHING IS WRONT WITH THIS FILE. WHERE IS IT?? my installation directory is at /home/natios/downloads/natios-3.2.3. I can only see /etc/nagios/objects/contacts.cfg after i did a find / -print. I assume this is the file to edit??)

5) Configure the Web Interface

Install the Nagios web config file in the Apache conf.d directory.

make install-webconf


Create a nagiosadmin account for logging into the Nagios web interface. Remember the password you assign to this account - you'll need it later.

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

I DID THIS htpasswd -c /etc/nagios/objects/htpasswd.users nagiosadmin


Restart Apache to make the new settings take effect.

service httpd restart

6) Compile and Install the Nagios Plugins

Extract the Nagios plugins source code tarball.

cd ~/downloads

tar xzf nagios-plugins-1.4.11.tar.gz

cd nagios-plugins-1.4.11


Compile and install the plugins.

./configure --with-nagios-user=nagios --with-nagios-group=nagios

make

make install

7) Start Nagios

Add Nagios to the list of system services and have it automatically start when the system boots.

chkconfig --add nagios

chkconfig nagios on


Verify the sample Nagios configuration files. (FAILED HERE!!) :roll: :roll: :roll:

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg


If there are no errors, start Nagios.

service nagios start

error message encountered.
Reading configuration data...
Read main config file okay...
Processing object config file '/etc/nagios/objects/commands.cfg'...
Processing object config file '/etc/nagios/objects/contacts.cfg'...
Processing object config file '/etc/nagios/objects/timeperiods.cfg'...
Processing object config file '/etc/nagios/objects/templates.cfg'...
Processing object config file '/etc/nagios/objects/localhost.cfg'...
Error: Could not find any contact matching 'nagiosgroup' (config file '/etc/nagios/objects/contacts.cfg', starting on line 51)
Error: Could not expand member contacts specified in contactgroup (config file '/etc/nagios/objects/contacts.cfg', starting on line 51)
Error processing object config files!

Re: Nagios install not successful

Posted: Mon Apr 11, 2011 2:05 pm
by rdedon
Is this a Nagios Core install or Nagios XI?

Re: Nagios install not successful

Posted: Mon Apr 11, 2011 10:50 pm
by jwoon

Re: Nagios install not successful

Posted: Tue Apr 12, 2011 2:56 pm
by rdedon
Installing Nagios Core on Fedora 14


1- First install some requered tools :

Code: Select all

yum  groupinstall "Development Libraries" "Development Tools"

Code: Select all

yum install gd gd-devel jpeg-devel rrdtools-devel
2- Create nagios user :

Code: Select all

#/usr/sbin/useradd -m nagios

Code: Select all

#passwd nagios
3- Add nagcmd group

Code: Select all

/usr/sbin/groupadd nagcmd

Code: Select all

/usr/sbin/usermod -a -G nagcmd nagios

Code: Select all

/usr/sbin/usermod -a -G nagcmd apache


4- Now go to http://www.nagios.org download these files .

nagios-3.2.3.tar.gz nagios-plugins-1.4.15.tar.gz

Code: Select all

tar  -zxvf  nagios-3.2.3.tar.gz

Code: Select all

cd  nagios-3.2.3

Code: Select all

./configure --with-command-group=nagcmd

Code: Select all

 #make all; make install; make install-init; make install-config; make install-commandmode; make install-webconf
5- Edit your email admin address :

To edit your email adress you need to edit the contact.cfg file

Code: Select all

vi /usr/local/nagios/etc/objects/contacts.cfg
(or whichever editor you prefer)

6- Create a nagiosadmin account for logging into the Nagios web interfaceassign to this you’ll need it later.

Code: Select all

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
enter the password.

7- Restart the httpd server :

Code: Select all

#service  httpd   restart


Installing Plugins

1- Go to the folder where you downloaded nagios tools, and extract the nagios-plugin file

Code: Select all

tar  -zxvf   nagios-plugins-1.4.15.tar.gz
2- cd nagios-plugins, then make and make install

Code: Select all

./configure --with-nagios-user=nagios --with-nagios-group=nagcmd

Code: Select all

make; make install
3- Now you have to add nagios to Chkconfig

Code: Select all

chkconfig --add nagios

Code: Select all

chkconfig nagios on
4- Verify if you have a good config of nagios with the command

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
5- Check if there are no errors displayed; then start nagios with command :

Code: Select all

service  nagios  start
To simplify the procedure please disable the selinux and iptables and ip6tables.

Now open your browser and http://localhost/nagios or http://ip/nagios (the IP being the machine that Nagios Core is installed on)

Re: Nagios install not successful

Posted: Tue Apr 12, 2011 11:12 pm
by jwoon
Good one. Some improvement but... I got the following error message after I did the stops (Are they complete and correct?)

service iptables stop
service ip6tables stop

Then I go to http://localhost/nagios/ and below is the error message when I try to click on the status. Anything missing? :roll:

I did apachectl stop and start (shows alread running)

I logged in using nagiosadmin/nagiosadmin
Also, is there a logout button in nagios main screen?
Thanks.

Error message.
----------------------
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache/2.2.17 (Fedora) Server at 192.168.222.130 Port 80

Re: Nagios install not successful

Posted: Wed Apr 13, 2011 2:24 am
by jwoon
Ok, good news. Nagios 3.2.3 is now working on Fedora 11. We have a show... :mrgreen: :mrgreen: :mrgreen:

I just did the setenforce 0 to get it going.

Thanks for your help.

Now, I would like to explore (If you can answer here, that will be good, if not, I'll post it on another thread. tks)
1) cpu, memory, filesize, logfile and snmp monitoring.
2) also to monitor remove machines like windows and qnx (Is this an agent or agentless based monitoring? Does it works on monitoring qnx os?)

getenforce


Put SELinux into Permissive mode.

setenforce 0

Re: Nagios install not successful

Posted: Mon Apr 18, 2011 2:53 pm
by rdedon
jwoon wrote:Ok, good news. Nagios 3.2.3 is now working on Fedora 11. We have a show... :mrgreen: :mrgreen: :mrgreen:

1) cpu, memory, filesize, logfile and snmp monitoring.
2) also to monitor remove machines like windows and qnx (Is this an agent or agentless based monitoring? Does it works on monitoring qnx os?)
For cpu, memory, filesize, logfile and snmp monitoring this is supported and very doable via already included wizards within NagiosXI.

You "can" use agents for monitoring Linux/Windows systems via NSClient++ and NSCA but am not aware of anything being available for QNX but will ask around.

I invite you to browse our Exchange site as this is a great resource with over 2000 listings:
http://exchange.nagios.org

Re: Nagios install not successful

Posted: Sat Oct 06, 2012 6:31 am
by inventsekar
i was searching for the "logout" and surprised to find out only two matches in this whole nagios core forum.. something must be wrong...

i did google and found this info... so, though its a very late reply to this post, still posting it so that when someone else searches same like me, they can get some answers.. ;)

Question:
> All,
> Is it possible to create logout for nagios web interface. As far
> as I understand, it is just matter of resetting the $_REMOTE_USER
> apache variable. Can someone please provide some guidance on this.
> Thanks
>
> --

Answer:
No, unfortunately it is not that easy. The problem is really not a
Nagios problem, but an HTTP authentication problem. Nagios uses HTTP
authentication, and that means that the user name and password are sent
with every single request. So when you try to reset this variable, it
will get set right back to what it was the next time the user requests a
page.

HTTP authentication did not envision ever logging out; that is one of
the reasons why most Web sites today use Web forms and session-based
logins instead. I think there are tricks around this problem with HTTP
Auth, though.