I'm sure this is a very dumb question with a very obvious answer, yet I've been unable to find it all morning.
I am trying to learn a little Nagios in a new job, and I have a group of Linux clients that all have the "NFS Mountpoints Check" service reporting back in the GUI (showing they are all correctly mounting what is in their /etc/fstab file) - except one. For whatever reason this single Linux client shows all other service/checks, but is missing the NFS Mountpoint Check in the GUI. I've run the command locally on the client without any issue, and manually ran it from the Nagios server successfully, but I can't figure out how to get Nagios to just run it and display it as part of all the other checks it's running? I can't seem to find what is different between those that are correctly showing this check and the one that is not.
My apologies!
How to add new service to existing Linux client
Re: How to add new service to existing Linux client
Are you restarting the Nagios Core daemon every time you apply configuration changes?
To answer this directly, and say "change this thing", I would need to see your entire set of Nagios object definitions.
Service objects can be associated with specific host objects in one of two ways (three if you count servicegroups but I won't get into that):
I can attach a specific service object to all of those hosts simultaneously by simply referencing the hostgroup, rather than having 3 separate service definitions for those 3 separate hosts:
Instead of this:
We can do this:
So, if you're leveraging services tied to specific hosts, you need to create a new copy of the "NFS Mountpoints Check" service for the host that is missing it. If you're leveraging services tied to groups of hosts, you need to include that host in the hostgroup.
To answer this directly, and say "change this thing", I would need to see your entire set of Nagios object definitions.
Service objects can be associated with specific host objects in one of two ways (three if you count servicegroups but I won't get into that):
- By defining a specific host the service object is associated with, via the host_name directive of the service object -- this is meant to reference a specific host object. This is a 1-to-1 relationship between a service definition and a host definition.
- By defining a group of hosts the service object is associated with, via the hostgroup_name directive of the service object -- this is meant to reference a specific hostgroup object. This is a 1-to-1 relationship between a service definition and a hostgroup definition, where a hostgroup definition represents a 1-to-many relationship between the hostgroup and one or more hosts.
Code: Select all
define host {
host_name linux-server-1
...
}
define host {
host_name linux-server-2
...
}
define host {
host_name linux-server-3
...
}
define hostgroup {
hostgroup_name linux-hosts
alias These be where my Linux hosts are
members linux-server-1,linux-server-2,linux-server-3
...
}
Instead of this:
Code: Select all
define service{
host_name linux-server-1
service_description Check My NFS mounts
check_command do_my_nfs_check_command
...
}
define service{
host_name linux-server-2
service_description Check My NFS mounts
check_command do_my_nfs_check_command
...
}
define service{
host_name linux-server-3
service_description Check My NFS mounts
check_command do_my_nfs_check_command
...
}
Code: Select all
define service{
hostgroup_name linux-hosts
service_description Check My NFS mounts
check_command do_my_nfs_check_command
...
}
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/