Adding another linux server to localhost.cfg

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).

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

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.

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

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: