Page 1 of 3

Completely missing nagios.cmd file in Ubuntu 12.04

Posted: Thu Dec 20, 2012 2:26 pm
by psyllex
Hello all,

I'm running Ubuntu 12.04 LTS I installed Nagios core and it's running fine. I added some definitions for hosts and services I want to monitor and went to restart nagios and it wouldn't allow me to. I get the following error when trying to restart from the browser: "Error: Could not stat() command file '/usr/local/nagios/var/rw/nagios.cmd'!"
When I tried to restart from command line I got: "

Code: Select all

bash: /etc/rc.d/init.d/nagios: No such file or directory
"

I did check the .conf file and I enabled external commands. But two things are missing in /etc there is no rc.d file. There is only a rcS.d file and that doesn't have a init.d file. And then within /usr/local/nagios/var/rw there is absolutely no nagios.cmd file. I went back did the make on install-commandmode but still no command file. I am using nagios-3.4.3. The docs from Nagios site seem to be from a few versions ago.

Can someone help me out? I seem to be missing two vital files.

Re: Completely missing nagios.cmd file in Ubuntu 12.04

Posted: Thu Dec 20, 2012 3:00 pm
by sreinhardt
Did you install from source or from the Ubuntu nagios3 package? You might try "service nagios restart" or "service nagios3 restart", I know ubuntu has started doing away with direct init.d/rc.d and moving towards service command, Fedora has taken it to the point that many /etc/rc.d/ files do not even exist anymore.

Re: Completely missing nagios.cmd file in Ubuntu 12.04

Posted: Thu Dec 20, 2012 4:06 pm
by psyllex
I installed it from source....download...unpacked...do all the make commands etc. But even within their directions nagios uses rcS.d not rc.d But within rcS.d there is not init.d file. There are multiple rc.d files 0-6 I belive. Not sure if that makes any difference.

Re: Completely missing nagios.cmd file in Ubuntu 12.04

Posted: Fri Dec 21, 2012 10:11 am
by sreinhardt
OK, sounds like they really have gone and changed some things with this latest release. I will take some time to install and see what I can find out for you!

Re: Completely missing nagios.cmd file in Ubuntu 12.04

Posted: Fri Dec 21, 2012 2:59 pm
by psyllex
Much appreciated. I did see that it seems to be running. I installed NRPE yesterday and then used the command they said to use which if memory serves me is:

Code: Select all

/usr/local/nagios/libexec/check_nrpe
That completely does not work. I got info from other sources who let me to the commands:

Code: Select all

/usr/lib/nagios/plugins/check_http -H 192.168.x.x 
that worked as well as

Code: Select all

 /usr/lib/nagios/plugins/check_icmp -H 192.168.x.x
. I couldn't use /usr/lib/nagios/plugins/check_snmp -H 192.168.x.x because it's only hooked up to my LAN with a switch..there is no router but that was good news at least. So patching together instructions from 4 different sources seems to have worked. The only issue is that is not going to give me the type of feedback I will need. Like bandwidth loss etc so I am still on the hunt for a solid solution.

Re: Completely missing nagios.cmd file in Ubuntu 12.04

Posted: Fri Dec 21, 2012 3:13 pm
by sreinhardt
Could you also link me to the install document you are using please?

Re: Completely missing nagios.cmd file in Ubuntu 12.04

Posted: Fri Dec 21, 2012 3:45 pm
by psyllex

Re: Completely missing nagios.cmd file in Ubuntu 12.04

Posted: Wed Dec 26, 2012 3:08 pm
by sreinhardt
That is quite the variance in sources. Looks like the first one does not actually install from source, the second has great depth but doesn't really follow our procedures, third, while ours is a little out dated, and fourth again mixes non source installed software. Provided you don't have anything with the current install that you really need, if so we can probably back it up, I would suggest using our newest guide. It should provide you with all the necessary scripts and files in the right places. Let me know if that works for you, and when done if that causes any further issues!

Re: Completely missing nagios.cmd file in Ubuntu 12.04

Posted: Mon Dec 31, 2012 3:29 pm
by psyllex
I'll give it a shot. Thanks a lot. Yes working with all those different resources was a bit confusing.

Re: Completely missing nagios.cmd file in Ubuntu 12.04

Posted: Mon Dec 31, 2012 5:12 pm
by psyllex
sreinhardt wrote:That is quite the variance in sources. Looks like the first one does not actually install from source, the second has great depth but doesn't really follow our procedures, third, while ours is a little out dated, and fourth again mixes non source installed software. Provided you don't have anything with the current install that you really need, if so we can probably back it up, I would suggest using our newest guide. It should provide you with all the necessary scripts and files in the right places. Let me know if that works for you, and when done if that causes any further issues!
Unfortunately that didn't work. I'm getting a "404" error from my web browser. I tried http://localhost/nagios with no success. I did notice when I followed the directions exactly, at this point:

Code: Select all

 htpasswd –c /usr/local/nagios/etc/htpasswd.users nagiosadmin
that it never truly allowed me to create a password. I am wondering...I stayed in /tmp the entire time as I was following the instructions to the letter. I checked /usr/local/nagios/etc and no htpasswd.users doesn't exist. should I go back to when I download the tars and then get out of the /tmp directory?