Page 1 of 2
[Fixed]Change "down" status
Posted: Mon Oct 26, 2015 8:06 am
by aruggeri
Hi guys,
I'm having the following problem with the monitoring nagios. As you can see from the picture, I have two hosts: Indra and Xarta under monitoring but in reality they are the hosts to be monitored and therefore the gaming me reports them in a state of "down" but are under a node level or levels Vmware51 intermediate. Therefore I wanted to ask if it is possible to eliminate the state of "down" from the hosts and Indra Xarta.
Thank you,
Andrea
Re: Change "down" status
Posted: Mon Oct 26, 2015 3:25 pm
by DiegoAnjos
You can create a template that does not contain the line
check_command check-host-alive:
Include this lines on templates.cfg:
Code: Select all
define host{
name generic-dead-host
use generic-host
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
notification_period 24x7
notification_interval 1440
notification_options d,r
contact_groups admins
register 0
}
I know that some lines above are useless to this template, but Nagios will return errors if you remove them.
Host definition:
Code: Select all
define host{
use generic-dead-host
host_name XXXXX
alias XXXX
address X.X.X.X
hostgroups xxxx
parents XXXX
notes_url http://X.X.X.X
icon_image_alt XXXX
icon_image webcamera.png
statusmap_image webcamera.png
retain_status_information 0
}
The hosts using the
generic-dead-host template will be shown as
PENDING and will never be checked.
For further details, read the article where I got this solution:
http://sourceforge.net/p/nagios/mailman ... /17918052/
Regards
Re: Change "down" status
Posted: Mon Oct 26, 2015 3:33 pm
by hsmith
Thanks for the help,
@DiegoAnjos.
Let us know if this works out for you
@aruggeri.
Re: Change "down" status
Posted: Tue Oct 27, 2015 7:17 am
by aruggeri
Good morning guys,
with the answers that you gave me.
I made the modifications described above, but the system is still not working.
I post as I defined my host:
Code: Select all
# A host definition for the gateway of the default route
define host {
host_name Indra
use generic-host
parents vmware51
}
define hostextinfo {
host_name Indra
icon_image cook/img.png
statusmap image cook/img.png
}
While within files hostgroups nagios 2.cfg I did the following:
for eliminating from the monitoring of the commands (in this case the I excluded only from the check table as it is a command used on all hosts):
Code: Select all
# Nagios does not like monitoring hosts without services, so this is
# A group for devices That have no other "services" monitorable
# (Like routers w / out snmp for example)
define hostgroup {
hostgroup_name ping-servers
alias pingable servers
members *,! Indra! Xarta,! MGMT
}
Re: Change "down" status
Posted: Tue Oct 27, 2015 9:04 am
by DiegoAnjos
arruegi,
I see that you are still using the generic-host template for Indra
define host {
host_name Indra
use generic-host
parents vmware51
}
You need to use the template that does not contain the command check-host-alive.
Could you post the files templates.cfg and hosts files?
Re: Change "down" status
Posted: Tue Oct 27, 2015 2:15 pm
by hsmith
Thank you,
@ DiegoAnjos!
@aruggeri, let us know what you come up with. Thanks!
Re: Change "down" status
Posted: Wed Oct 28, 2015 6:59 am
by aruggeri
Good morning guys,
as always, thank you the help that you are giving me.
Unfortunately they are just starting out with the Nagios system and of the time I still have difficulties in the administration of the total system.
Then I as a configuration file using the following:
/etc/nagios3/conf.d/indra.cfg
and its content is as follows:
Code: Select all
# A host definition for the gateway of the default route
define host {
host_name Indra
use generic-host
parents vmware51
}
define hostextinfo {
host_name Indra
icon_image cook/clienti.png
statusmap_image cook/clienti.png
}
For "template.cfg" What do you mean?
Greetings,
Andrea
Re: Change "down" status
Posted: Wed Oct 28, 2015 7:24 am
by eloyd
Nagios comes pre-shipped with a configuration file called "template.cfg" in the same directory as all your other config files. He's asking for that.
Also, rather than not have a check_command and have hosts show pending, I recommend using the check_dummy command, which will simply return whatever state you give it without actually doing anything. In essence, your check_command becomes "check_dummy 0" if you always want the hosts to show as OK.
Re: Change "down" status
Posted: Wed Oct 28, 2015 8:38 am
by aruggeri
Unfortunately guys inside my directory:
/etc/nagios3/conf.d/ I not have the file called "template.cfg"
Below you will find the contents of that directory tree:
Code: Select all
root@nagios51:~# ls /etc/nagios3/conf.d
backup51.cfg indrabe01coll.cfg services_nagios2.cfg
contacts_nagios2.cfg indrabe01ese.cfg services_nagios2.cfg~
contacts_nagios2.cfg~ indra.cfg services_nagios2.cfgu
demobe.cfg indrafe01coll.cfg spappbe02ese.cfg
demofe.cfg indrafe01ese.cfg spappfe02ese.cfg
dns51.cfg localhost_nagios2.cfg switch51.cfg
extinfo_nagios2.cfg log51.cfg testbe.cfg
ferservizibe01coll.cfg mgmt.cfg testfe.cfg
ferservizife01coll.cfg mon01.cfg timeperiods_nagios2.cfg
fw02.cfg mon02.cfg vmware51.cfg
fw03.cfg nagios52.cfg vmware53.cfg
fw04.cfg nas41.cfg xartabe01coll.cfg
gateway.cfg nas51.cfg xartabe01ese.cfg
generic-host_nagios2.cfg ricettebe01coll.cfg xarta.cfg
generic-service_nagios2.cfg ricettefe01coll.cfg xartafe01coll.cfg
hostgroups_nagios2.cfg sens01.cfg xartafe01ese.cfg
hostgroups_nagios2.cfg~ sens02.cfg
I hope that the information that I am giving are sufficient to explain the type of problem encountered.
Greetings,
Andrea.
Re: Change "down" status
Posted: Wed Oct 28, 2015 8:47 am
by eloyd
It will likely be in the generic-host_nagios2.cfg file. You can type "grep generic-host *" to find out which file your generic-host template is in. That's likely the one that needs to be updated.