Clarification need on configuring nagios to monitor multiple hosts
Zaman
queszama at yahoo.in
Thu Jul 14 13:14:35 CEST 2011
Jim Avery <jim <at> jimavery.me.uk> writes:
>
>
> You'll find useful help on that here:
>
> http://nagios.sourceforge.net/docs/nagioscore/3/en/objecttricks.html
>
> > Can't I use comma separated ip address and hosts like this
> >
> > 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 node1,node2
> > alias node1
> > address 192.168.122.167,192.168.122.218
> > }
>
> No. You do need separate host definitions, but you can add each host
> to the same hostgroup for example by adding a directive like this to
> the host definition:
>
> hostgroup_name linux-group
>
> (in fact you can add that to the host template instead if you like).
>
> You will need to define this new hostgroup:
>
> define hostgroup{
> hostgroup_name linux-group
> alias linux-group hostgroup containing all
> monitored linux servers
> }
>
> >
> > define service{
> > use
> local-service ; Name of service template to use
> > host_name node1,node2
> > service_description Current Users
> > check_command check_nrpe!check_users
> > }
>
> In that example, you can now use the hostgroup like so:
>
> define service{
> use local-service ; Name
> of service template to use
> hostgroup_name linux-group
> service_description Current Users
> check_command check_nrpe!check_users
> }
>
> I hope that helps a little.
Thanks Jim . That really helped . I am now able to remove the duplicate entries
for each services by having a single entry for every hosts for a single service.
The following entry I created as per your suggestion
====
define hostgroup{
hostgroup_name linuxservers ; The name of the hostgroup
alias linux Servers ; Long name of the group
members node1,node2 ; Comma separated list of hosts that
; belong to this group
}
define service{
use local-service ; Name of service
template to use
hostgroup_name linuxservers
service_description Current Users
check_command check_nrpe!check_users
}
But I am still confused with the host definition. I am having a single host
entry for each of the hosts like this
define host{
use linux-server
host_name node1
alias node1
address 192.168.122.167
}
define host{
use linux-server
host_name node2
alias node2
address 192.168.122.218
}
Is it possible any way to maintain a single entry for all the servers like we
did for the service object .
Any suggestions..
Thanks
Zman
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list