mv .cfg for switch I don't want to monitor crashes Nagios

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.
billperrotta
Posts: 115
Joined: Fri Feb 21, 2014 11:44 am

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Post by billperrotta »

ahgmonitor:~ # grep -R 'Amsterdam Court' /etc/nagios/objects/* | grep -i 'host_name'
/etc/nagios/objects/computers/hotels/amcourt.cfg: host_name Amsterdam Court
/etc/nagios/objects/computers/hotels/amcourt.cfg: host_name Amsterdam Court
/etc/nagios/objects/computers/hotels/amcourt.cfg: host_name Amsterdam Court
ahgmonitor:~ # grep -R 'AMCourt innGate' /etc/nagios/objects/* | grep -i 'host_name'
/etc/nagios/objects/devices/inngates/ant_amcourt.cfg: host_name AMCourt innGate
ahgmonitor:~ #
Would those be the files? "Amsterdam Court and AMCourt innGate"

To make it clear "I do not want to remove the Amcourt parent" I want to remove the Amcourt inngate without crashing the whole system.

amcourt.cfg below
hostgroups hotel-servers
parents AH-AMCourt
}
5>
define service{
use generic-service
host_name Amsterdam Court
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l C -w 80 -c 90
notification_interval 1440
notification_options w,r
notification_period work-holiday
servicegroups drivespace
}
{>
(>define service{
use generic-service
host_name Amsterdam Court
service_description D:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l D -w 90 -c 95
notification_interval 1440
notification_options w,r
.> notification_period work-holiday
I wanted to remove the .cfg to this node "sw_amct.cfg" nothing more. would commenting #AH-Parent out of those two files remove whole site?
or maybe I need to make a different object the parent?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Post by sreinhardt »

Yes commenting out or removing the parent line is what you are looking to do. Then do another nagios -v command to verify your configs and report back the output. Hopefully it says everything is ok or only has warnings.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
billperrotta
Posts: 115
Joined: Fri Feb 21, 2014 11:44 am

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Post by billperrotta »

Can I edit it without stopping nagios?

will flight check work and then if it fails put it right back ask for more help?

And allow me to remove the amcourt_sw.cfg file?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Post by sreinhardt »

Can I edit it without stopping nagios?
Yep, not an issue at all
will flight check work and then if it fails put it right back ask for more help?
That sounds fine, provided you send us the output of the potentially failed verification.
And allow me to remove the amcourt_sw.cfg file?
You can certainly try, however it is impossible for us to know without having your actual config files to check against ourselves as to where there might be other dependencies on items within that configuration.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
billperrotta
Posts: 115
Joined: Fri Feb 21, 2014 11:44 am

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Post by billperrotta »

Do i have to make sure I remove the file that broke it also to make sure?
So pounding out the parent statements will still allow those objects to be monitored but allow me to remove the switch.cfg child with out crashing nagipos?
however if there is another parent still out there somewhere it will still crash?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Post by scottwilkerson »

As sreinhardt said, it is impossible for us to know without seeing all the configs, you can however make your changes and then try verifying the configuration to see if it will be sucessful before restarting nagios.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
billperrotta
Posts: 115
Joined: Fri Feb 21, 2014 11:44 am

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Post by billperrotta »

That worked However it took out a piece of my pie on the map.
May see what the other guys think about it.
Its fine that host is gone the desired effect.
I backed up the object just in case.
I mastered adding nodes I guess I have to start somewhere to learn removing them.
is there a way to fill in the blank white spot in the map where the node was?
With green to complete the circle diagram?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Post by tmcdonald »

Can you post a screenshot of what you mean?
Former Nagios employee
billperrotta
Posts: 115
Joined: Fri Feb 21, 2014 11:44 am

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Post by billperrotta »

See word doc below. Ah-Amcourt used to be in the inner most circle and the other two completed the circle on the top. after removing the parent ah- amcourt there is a white space on top,and the green circle is no longer complete. This is not a huge deal only cosmetic. but was wondering if there was away to fill it in with greene?
Attachments
nagiospiccurrent.docx
(195.7 KiB) Downloaded 289 times
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: mv .cfg for switch I don't want to monitor crashes Nagio

Post by scottwilkerson »

In the map I cannot see what "Layout Method:" you have specified?
What version of Nagios Core is this?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked