I’ve been searching for the solution to this, but I can’t seem to find one.
I am monitoring 2 servers (I’ll expand this, when I get this working), each itself and from the other. That is, I have localserver monitoring localserver and remoteserver (through NRPE) and remoteserver monitoring localserver(through NRPE) and remoteserver.
If I log in to remoteserver/nagios, I can see both servers. However, if I log in to localserver/nagios, I cannot see remoteserver, but if remoteserver goes down, I get notifications from localserver!
The commands all checked out both ways for NRPE. Also, on server2 I can add a 2nd hostgroup and it will display:
define hostgroup{
hostgroup_name local-servers ; The name of the hostgroup
alias Local Servers ; Long name of the group
members localhost ; Comma separated list of hosts that belong to this group
}
However, if I try that on localserver, no dice.
From localhost:
in remotehost.cfg (which is called in nagios.cfg):
define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name remoteserver.mydomain.com
alias remote
address xxx.xxx.xxx.xxx
check_command check_nrpe!check_http
}
I even defined a 2nd hostgroup with just remoteserver in it:
define hostgroup{
hostgroup_name dumb-servers ; The name of the hostgroup
alias dumb Servers ; Long name of the group
members sparky.engineno9inc.com ; Comma separated list of hosts that belong to this group
}
And in localserver.cfg, I have:
define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name localhost
alias localserver
address 127.0.0.1
}
###############################################################################
###############################################################################
HOST GROUP DEFINITION
###############################################################################
###############################################################################
Define an optional hostgroup for Linux machines
define hostgroup{
hostgroup_name remote-servers ; The name of the hostgroup
alias Remote Servers ; Long name of the group
members remoteserver.mydomain.com ; Comma separated list of hosts that belong to this group
}
define hostgroup{
hostgroup_name linux-servers ; The name of the hostgroup
alias Linux Servers ; Long name of the group
members localhost,remoteserver.mydomain.com ; Comma separated list of hosts that belong to this group
}
I appreciate any help anyone can lend.
Thanks,
Alden