Page 1 of 1
Incorrect path in my nagios installation
Posted: Thu Sep 26, 2013 12:49 pm
by mawkix
Hello,
I've been tasked with standing up a Nagios host in the cloud (AWS)
I didn't install from source but, rather via 'apt-get install nagios3'
Seemingly the path should be in /usr/local/ but ps shows:
ubuntu@ip-172-31-13-137:/etc/nagios3$ ps -ef | grep nagios
ubuntu 1586 26663 0 17:41 pts/1 00:00:00 grep --color=auto nagios
nagios 28360 1 0 16:52 ? 00:00:01 /usr/sbin/nagios3 -d /etc/nagios3/nagios.cfg
ubuntu@ip-172-31-13-137:/etc/nagios3$ ps aux | grep nagios.cf | grep -v grep
nagios 28360 0.0 0.1 37084 1876 ? SNsl 16:52 0:01 /usr/sbin/nagios3 -d /etc/nagios3/nagios.cfg
Can someone point me in the right direction?
Thanks ahead of time.
-Mark
Re: Incorrect path in my nagios installation
Posted: Thu Sep 26, 2013 12:55 pm
by tmcdonald
The paths will be different depending on whether you compiled from source, installed from an RPM repository, or installed from a DEB repository. Since you installed from DEB, you will note the following paths:
Program location - /usr/bin/nagios3
Config file - /etc/nagios3/nagios.cfg
Plugins - /usr/lib/nagios/plugins
If you had compiled, you would see:
Program location - /usr/local/nagios/bin/nagios
Config file - /usr/local/nagios/etc/nagios.cfg
Plugins - /usr/local/nagios/libexec
Just one of those things that you need to mentally translate when reading docs.
Re: Incorrect path in my nagios installation
Posted: Thu Sep 26, 2013 1:02 pm
by mawkix
Thank you so much for the reply.
So in regards the .cfg file pointing to say cfg_file=/etc/nagios3/objects/windows.cfg where there is no objects folder, does this need to be created manually? Or any other incorrect path for that matter?
Thanks ahead of time.
-Mark
Re: Incorrect path in my nagios installation
Posted: Thu Sep 26, 2013 1:04 pm
by tmcdonald
Correct. If a script is specifically looking for a file in that folder, then you need to create both the folder and the file, otherwise you will receive errors. Make sure as always to check permissions and ownership for such files and folders.
Re: Incorrect path in my nagios installation
Posted: Thu Sep 26, 2013 1:07 pm
by mawkix
Thank you sir.
I'm guessing that files should be owned by www-data?
Re: Incorrect path in my nagios installation
Posted: Thu Sep 26, 2013 1:10 pm
by tmcdonald
Nagios config files should be owned by the same user that nagios is running as, usually just "nagios". There aren't any cases I can think of where that would not need to be the case.
Re: Incorrect path in my nagios installation
Posted: Thu Sep 26, 2013 1:17 pm
by mawkix
Ok awesome!
Thank you so much for the help. This is my first Nagios install. I've been using CACTI forever.
Thanks again for your help.
Re: Incorrect path in my nagios installation
Posted: Thu Sep 26, 2013 1:19 pm
by tmcdonald
My pleasure. If you have any other questions, please feel free to open up another thread. Locking this one.
Re: Incorrect path in my nagios installation
Posted: Thu Sep 26, 2013 1:25 pm
by lmiltchev
As long as apache is added to the nagios group, you should be fine. In Ubuntu, you would see "www-data" instead of "apache". You can run the following command to verify:
...there is no objects folder, does this need to be created manually?
Ubuntu tends to do things *differently*. When you install from repo, your paths would be different. If you decide to create "objects" folder, you will need to place the path to it in the "nagios.cfg". However, most of the configs are placed in "/etc/nagios3/conf.d/" folder "by default". You put your configs there as well if you wish.