Host and Service configuration Problem

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.
Post Reply
mehmwt
Posts: 5
Joined: Fri Feb 16, 2024 8:09 am

Host and Service configuration Problem

Post 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
Attachments
I have defined only PING service, why i have more services
I have defined only PING service, why i have more services
Router must not be member of switch
Router must not be member of switch
Screenshot of switch.cfg file for further reference
Screenshot of switch.cfg file for further reference
gwesterman
Posts: 94
Joined: Wed Aug 23, 2023 11:29 am

Re: Host and Service configuration Problem

Post 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!
mehmwt
Posts: 5
Joined: Fri Feb 16, 2024 8:09 am

Re: Host and Service configuration Problem

Post 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
Attachments
restart_nagios
restart_nagios
restart_nagios.PNG (4.63 KiB) Viewed 411 times
verification_step
verification_step
etc folder containing nagios.file
etc folder containing nagios.file
etc_folder.PNG (9.22 KiB) Viewed 411 times
path details of nagios file
path details of nagios file
nagios_file_path.PNG (5.07 KiB) Viewed 411 times
gwesterman
Posts: 94
Joined: Wed Aug 23, 2023 11:29 am

Re: Host and Service configuration Problem

Post 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.
Post Reply