Adding another linux server to localhost.cfg


#1

Has[code]define host{
use linux-server
host_name localhost
alias nagios server
address 127.0.0.1
}

define host{
use linux-server
host_name remotehost
alias some alias
address 192.168.135.21
}

define hostgroup{
hostgroup_name linux-servers
alias linux servers
members localhost, remotehost
}

define service{
use local-service
hostgroup_name linux-servers
service_description Current Users
check_command check_local_users!20!50
}[/code]
My problem is that both entries in the webinterface shows the number of users on the localhost and I cant see any errors (and check/reload works fine).
Nagios 3.0.3 on ubuntu 8.0.4 (desktop).


#2

Hi!

I’m not sure I understood the question, so if I’m not answering it, sorry :slight_smile:

=> I’m not really familiar with the directive “hostgroup_name” in a service definition. So, my advice, do:

define service{
use local-service
host_name localhost, remotehost
service_description Current Users
check_command check_local_users!20!50
}

I hope that will help you; if not, don’t hesitate to post again


#3

Thank you for your suggestion,
The hostgroup_name with my def is a shortcut to host_name localhost,remotehost.
I tried your suggestion but to no avail.


#4

You have defined “check_local_users” as the check command for the entire host group. The remote servers need to be checked using NRPE or similar. See nagios.sourceforge.net/docs/3_0/ … linux.html for more information on monitoring remote linux servers


#5

TY - I must have been blind…
Found that I needed to install plugins on the remote server but except that you scored 100 points :wink: