Incorrect path in my nagios installation

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
mawkix
Posts: 5
Joined: Thu Sep 26, 2013 12:36 pm

Incorrect path in my nagios installation

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Incorrect path in my nagios installation

Post 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.
Former Nagios employee
mawkix
Posts: 5
Joined: Thu Sep 26, 2013 12:36 pm

Re: Incorrect path in my nagios installation

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Incorrect path in my nagios installation

Post 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.
Former Nagios employee
mawkix
Posts: 5
Joined: Thu Sep 26, 2013 12:36 pm

Re: Incorrect path in my nagios installation

Post by mawkix »

Thank you sir.

I'm guessing that files should be owned by www-data?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Incorrect path in my nagios installation

Post 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.
Former Nagios employee
mawkix
Posts: 5
Joined: Thu Sep 26, 2013 12:36 pm

Re: Incorrect path in my nagios installation

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Incorrect path in my nagios installation

Post by tmcdonald »

My pleasure. If you have any other questions, please feel free to open up another thread. Locking this one.
Former Nagios employee
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Incorrect path in my nagios installation

Post 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:

Code: Select all

grep nagios /etc/group
...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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked