Monitoring services
A service in nagios defines a particular test which should be run. At a minimum you need to define a name for the service and the command to run in order to monitor it.
Similar to hosts, it is defined within .cfg files in /etc/nagios3/conf.d or a subdirectory. At a technical level, there is no difference between a .cfg file that defines a host versus one that defines a service. They are split in Ubuntu's default configuration just for ease of management. If you wanted to, you could have a single flat .cfg that defines all hosts, services, and users.
How to do it…
Again I like to split my services into a subdirectory, so let's look at defining a service to monitor HP Jetdirect printers by creating /etc/nagios3/conf.d/services/printer.cfg ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access