I am very new to Nagios , anyway I have it pre-installed i need to modify it a bit
I watched the self paced learning video but i still failed to carry out the task so i need help.
In the web interface under services in Nagios I have 4 number hosts to be checked which are printers they are not in use so i decided to remove them .
In nagios>congif folder there are two files which i found related to the printers
1- hostgroups.cfg
define hostroups {
hostgroup_name Printers
alias CUPS printers
members rlprt01,rlprt20,rlprt70,rlprt80
}
2. service_distants.cfg
define service {
hostgroup_name Printers
services_description CHK - Print spooler
check_command check_lpqueue
use generic-service
notification_interval 0
}
so what I did is removing the
define hostroups {
hostgroup_name Printers
alias CUPS printers
members rlprt01,rlprt20,rlprt70,rlprt80
}
from the hostgroups,cfg then i used the command to restart nagios (service nagios restart) but i got an error which is
Configuration validation failed
Any suggestion how to make this works . i need to remove the printers check
screen shots attached
newbi quations about hosts and servics
newbi quations about hosts and servics
- Attachments
-
- services_distants.zip
- (31.88 KiB) Downloaded 186 times
Re: newbi quations about hosts and servics
Did you remove the entire hostgroup (Printers) or just the two members (hosts) that you wanted to remove? Which host the "CHK307 - Print spooler" service is attached to? The service is added to the "Printers" hostgroup, so it would show up under each host, member of this group, unless you remove the host from the "Printers" hostgroup.so what I did is removing the
define hostroups {
hostgroup_name Printers
alias CUPS printers
members rlprt01,rlprt20,rlprt70,rlprt80
}
from the hostgroups,cfg then i used the command to restart nagios (service nagios restart) but i got an error which is
Configuration validation failed
What is the exact error that you see when you verify the configuration?
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: newbi quations about hosts and servics
lmiltchev wrote:Did you remove the entire hostgroup (Printers) or just the two members (hosts) that you wanted to remove? Which host the "CHK307 - Print spooler" service is attached to? The service is added to the "Printers" hostgroup, so it would show up under each host, member of this group, unless you remove the host from the "Printers" hostgroup.so what I did is removing the
define hostroups {
hostgroup_name Printers
alias CUPS printers
members rlprt01,rlprt20,rlprt70,rlprt80
}
from the hostgroups,cfg then i used the command to restart nagios (service nagios restart) but i got an error which is
Configuration validation failed
What is the exact error that you see when you verify the configuration?
Note: If the path to the nagios binary or the main config file is different, please modify the above command accordingly.Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Ok , as I know if you have to put the *.cfg file in Nagios.cfg
but this is not case here , in Nagios.cfg they point to a folder where I find this hostgroups.cfg
and I have deleted the whole section from hotgroups.cfg
define hostroups {
hostgroup_name Printers
alias CUPS printers
members rlprt01,rlprt20,rlprt70,rlprt80
}
and then I did a restart and it failed ( Configuration Validation failed)
then I did your command so I ran this
( /usr/local/bin/nagios-sync -v /etc/nagios/nagios.cfg)
and the output is this
sending incremental file list
nagios/config/
nagios/config/hostgroups.cfg
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: newbi quations about hosts and servics
I noticed this in your post
This leads me to believe it is more than just the nagios binary.
Does it by chance sync you configurations and then execute the commands to the real binary?
What is nagios-sync?grafix143 wrote:Code: Select all
/usr/local/bin/nagios-sync -v /etc/nagios/nagios.cfg
This leads me to believe it is more than just the nagios binary.
Does it by chance sync you configurations and then execute the commands to the real binary?
Re: newbi quations about hosts and servics
Hi Scott,scottwilkerson wrote:I noticed this in your postWhat is nagios-sync?grafix143 wrote:Code: Select all
/usr/local/bin/nagios-sync -v /etc/nagios/nagios.cfg
This leads me to believe it is more than just the nagios binary.
Does it by chance sync you configurations and then execute the commands to the real binary?
TBH , I have no clue what are you talking about (real binary) and I also don't know what is nagios-sync , I was looking for the file nagios in this folder but I couldn't find anything else than nagios-sync .
I will try to search for what you just mentioned I may make sense out of it .
Re: newbi quations about hosts and servics
What I got from this is he deleted something that looked like
from a file named "hostgroups.cfg" which I find a bit odd. None of my nagios files are simply called hostgroups.cfg so sounds like somebody did some modifying of file names.
Have you tried simply putting back in what you deleted? I included above what you deleted & corrected the misspelling you provided prior.
After you replace what you deleted then verify the config using
and then restart nagios and see if it fixes it.
Code: Select all
define hostgroup{
hostgroup_name Printers
alias CUPS printers
members rlprt01,rlprt20,rlprt70,rlprt80
}
Have you tried simply putting back in what you deleted? I included above what you deleted & corrected the misspelling you provided prior.
After you replace what you deleted then verify the config using
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: newbi quations about hosts and servics
How was nagios installed on this server? Really before we proceed we need to know what we are dealing with because "nagios-sync" is not what the file should be called and is likely some modification.grafix143 wrote:TBH , I have no clue what are you talking about (real binary) and I also don't know what is nagios-sync , I was looking for the file nagios in this folder but I couldn't find anything else than nagios-sync .