Nagios service fails to start

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.
jannetta
Posts: 9
Joined: Tue Sep 06, 2016 6:35 am

Nagios service fails to start

Post by jannetta »

Hi Folks

I decided to try and get Nagios working on a Raspberry Pi. I have followed the instructions on http://www.myrelayman.com/download/Basi ... -Setup.txt (linked to from http://www.myrelayman.com/download/Basi ... -Setup.txt)

Everything seems to work except that the nagios service won't start. "journalctl -xn" gives the following error: wlan0: DHCPv6 REPLY: No Addresses Available

I did some googling and found references to dnsmasq, which turned out not to be installed. I installed it and it is now running but nagios is still giving the same error so I guess dnsmasq is still not doing its thing (whatever its things is supposed to be). I'm at a bit of a loss a I don't have any knowledge of configuring dnsmasq. Can someone perhaps help me out with some guidance on what dnsmasq settings would be required to make nagios work?

Kind Regards
Jannetta
Last edited by jannetta on Wed Sep 07, 2016 7:24 am, edited 1 time in total.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios service fails to start

Post by rkennedy »

What is the full output of ip a from the machine? Does it have an IP assigned to it?
Former Nagios Employee
jannetta
Posts: 9
Joined: Tue Sep 06, 2016 6:35 am

Re: Nagios service fails to start

Post by jannetta »

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether b8:27:eb:44:31:e7 brd ff:ff:ff:ff:ff:ff
inet6 fe80::e8eb:a8c6:53f7:61ce/64 scope link tentative
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:e0:4b:a2:92:fd brd ff:ff:ff:ff:ff:ff
inet 192.168.1.20/24 brd 192.168.1.255 scope global wlan0
valid_lft forever preferred_lft forever
inet6 fe80::2e0:4bff:fea2:92fd/64 scope link
valid_lft forever preferred_lft forever
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios service fails to start

Post by ssax »

Did you edit /etc/network/interfaces and set it to static?
jannetta
Posts: 9
Joined: Tue Sep 06, 2016 6:35 am

Re: Nagios service fails to start

Post by jannetta »

Yes, here is my interfaces file:

Code: Select all

auto lo
auto wlan0
iface lo inet loopback

iface eth0 inet manual


allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan0
iface wlan0 inet static
        address 192.168.1.20
        network 192.168.1.0
        gateway 192.168.1.1
        netmask 255.255.255.0
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
jannetta
Posts: 9
Joined: Tue Sep 06, 2016 6:35 am

Re: Nagios service fails to start

Post by jannetta »

Yes, here is my interfaces file:

Code: Select all

auto lo
auto wlan0
iface lo inet loopback

iface eth0 inet manual


allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan0
iface wlan0 inet static
        address 192.168.1.20
        network 192.168.1.0
        gateway 192.168.1.1
        netmask 255.255.255.0
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios service fails to start

Post by tgriep »

Can you login to the Raspberry Pi, run the following and post the output here?

Code: Select all

/etc/init.d/nagios3 configtest
/etc/init.d/nagios3 restart
Be sure to check out our Knowledgebase for helpful articles and solutions!
jannetta
Posts: 9
Joined: Tue Sep 06, 2016 6:35 am

Re: Nagios service fails to start

Post by jannetta »

There is no configtest, but here goes. I tried a nagios 3 status too. It seems from the status that there are problems in the config file. I don't know what would be wrong in the config file though. I just changed it as per the instructions. I can paste the config file too if it would help.

Code: Select all


/etc/init.d/nagios3 configtest
[FAIL] Usage: /etc/init.d/nagios3 {start|stop|restart|reload|force-reload|status} ... failed!

root@nagios:~# /etc/init.d/nagios3 status
● nagios3.service - LSB: nagios host/service/network monitoring and management system
   Loaded: loaded (/etc/init.d/nagios3)
   Active: failed (Result: exit-code) since Wed 2016-09-07 20:49:34 UTC; 2h 23min ago
  Process: 1665 ExecStart=/etc/init.d/nagios3 start (code=exited, status=1/FAILURE)

Sep 07 20:49:34 nagios nagios3[1665]: directives and data defintions.  If you are upgrading from a previous
Sep 07 20:49:34 nagios nagios3[1665]: version of Nagios, you should be aware that some variables/definitions
Sep 07 20:49:34 nagios nagios3[1665]: may have been removed or modified in this version.  Make sure to read
Sep 07 20:49:34 nagios nagios3[1665]: the HTML documentation regarding the config files, as well as the
Sep 07 20:49:34 nagios nagios3[1665]: 'Whats New' section to find out what has changed.
Sep 07 20:49:34 nagios systemd[1]: nagios3.service: control process exited, code=exited status=1
Sep 07 20:49:34 nagios systemd[1]: Failed to start LSB: nagios host/service/network monitoring and management system.
Sep 07 20:49:34 nagios systemd[1]: Unit nagios3.service entered failed state.
Sep 07 20:49:34 nagios nagios3[1665]: errors in config! ... failed!
Sep 07 20:49:34 nagios nagios3[1665]: failed!
root@nagios:~# 
jannetta
Posts: 9
Joined: Tue Sep 06, 2016 6:35 am

Re: Nagios service fails to start

Post by jannetta »

Attached should be the config file. I have removed all commented lines.
Attachments
nagios.cfg
(3.12 KiB) Downloaded 349 times
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios service fails to start

Post by tgriep »

Can you run the following command to verify the settings for the config files and post the output here?

Code: Select all

nagios -vv /etc/nagios3/nagios.cfg
You may need to add the path to the beginning of the command to where the Nagios binary file is located on the drive.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked