Page 1 of 1

Host and Service configuration Problem

Posted: Thu Feb 22, 2024 8:53 am
by mehmwt
Hello,

I am new to nagios and using it nagios core (4.4.9) first time. I have added router in nagios environment by following this documentation
( https://assets.nagios.com/downloads/nag ... uters.html ),

But I have encountered some problems for which I need your guidance.

1) First, i have added a router in nagios, which should be member of router not switch (Screenshot not_switch is attached for reference)

2)Second, i have defined only one service PING to monitor but it shows other services as well which i did not defined in my switch.cfg file. (switch.cfg file screenshot is attached for reference)

I have attached also the screenshot of switch.cfg file for further reference.

Please guide me if i am missing something important in switch.cfg file or making some errors

Thanks

Re: Host and Service configuration Problem

Posted: Thu Feb 22, 2024 10:25 am
by gwesterman
Hi @mehmwt,

It appears as if core is still reading from the default switch.cfg file which has definitions for all of the services you're seeing and places the host in the switches hostgroup. I would make sure of 3 things:
1. The changes you made to switch.cfg have saved
2. The main Nagios config file is pointing to the right place
3. You have verified your configuration and restarted Nagios core.

Let us know what you find.

Thank you!

Re: Host and Service configuration Problem

Posted: Tue Feb 27, 2024 5:03 am
by mehmwt
Thanks for your reply

1) I have check the switch.cfg file and it is saved correctly.

2) I have checked the path of nagios.cfg file and it looks fine but i have attached the screenshoot (nagios_file_path) for your reference. In addition
i have attached the screenshot (etc_folder) of etc folder containing nagios.cfg file.

3) I have carried out the verification step (Screenshot is attached as verification step) which results shows zero warning and zero error.

4) Finally, i have executed the restart command to restart nagios. (screenshot as restart_nagios)


But still i find the same results which were before.

Thanks

Re: Host and Service configuration Problem

Posted: Tue Feb 27, 2024 10:17 am
by gwesterman
Hi @mehmwt,

1) Good
2) It looks like you renamed the file to router.cfg. Make sure that the file path in

Code: Select all

/usr/local/nagios/etc/nagios.cfg
is correct (i.e. the line

Code: Select all

cfg_file=/usr/local/nagios/etc/objects/switch.cfg
is changed to

Code: Select all

cfg_file=/usr/local/nagios/etc/objects/router.cfg
). There may be additional places where the filename has to be changed as well, but I am not certain at the moment. It might be worth it to just keep the filename as switch.cfg while you try to figure this out.
3) Good
4) It looks like you started nagios, but didn't necessarily restart it. I would make sure to follow the steps in the "Restarting Nagios Core" section of this document.