newbi quations about hosts and servics

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

newbi quations about hosts and servics

Postby grafix143 » Sat Feb 10, 2018 11:51 pm

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
Attachments
services_distants.zip
(31.88 KiB) Downloaded 14 times
grafix143
 
Posts: 6
Joined: Thu Feb 08, 2018 4:38 am

Re: newbi quations about hosts and servics

Postby lmiltchev » Mon Feb 12, 2018 3:03 pm

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

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.

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


Note: If the path to the nagios binary or the main config file is different, please modify the above command accordingly.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 10304
Joined: Mon May 23, 2011 12:15 pm

Re: newbi quations about hosts and servics

Postby grafix143 » Mon Mar 05, 2018 5:31 am

lmiltchev wrote:
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

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.

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


Note: If the path to the nagios binary or the main config file is different, please modify the above command accordingly.



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
grafix143
 
Posts: 6
Joined: Thu Feb 08, 2018 4:38 am

Re: newbi quations about hosts and servics

Postby scottwilkerson » Mon Mar 05, 2018 3:38 pm

I noticed this in your post
grafix143 wrote:
Code: Select all
/usr/local/bin/nagios-sync -v /etc/nagios/nagios.cfg


What is nagios-sync?

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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 10514
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: newbi quations about hosts and servics

Postby grafix143 » Mon Mar 05, 2018 11:00 pm

scottwilkerson wrote:I noticed this in your post
grafix143 wrote:
Code: Select all
/usr/local/bin/nagios-sync -v /etc/nagios/nagios.cfg


What is nagios-sync?

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?


Hi Scott,
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 . :roll:
grafix143
 
Posts: 6
Joined: Thu Feb 08, 2018 4:38 am

Re: newbi quations about hosts and servics

Postby t3dus » Tue Mar 06, 2018 7:26 am

What I got from this is he deleted something that looked like

Code: Select all
define hostgroup{
        hostgroup_name  Printers
        alias           CUPS printers
        members         rlprt01,rlprt20,rlprt70,rlprt80
        }


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
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg


and then restart nagios and see if it fixes it.
User avatar
t3dus
 
Posts: 109
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA

Re: newbi quations about hosts and servics

Postby scottwilkerson » Tue Mar 06, 2018 10:16 am

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 .


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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 10514
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 14 guests