Reader small image

You're reading from  Linux Networking Cookbook

Product typeBook
Published inJun 2016
Publisher
ISBN-139781785287916
Edition1st Edition
Concepts
Right arrow
Authors (2):
Gregory Boyce
Gregory Boyce
author image
Gregory Boyce

Gregory Boyce is a technologist with nearly 20 years' experience using and managing Linux systems. When he's not at work or spending time with his wife and two daughters, he plays around with new technologies. Gregory has spent the last 15 years working at Akamai Technologies, where he has worked in roles ranging from Network Operations, Internal IT, Information Security, Software Testing, and Professional Services. Currently, he heads up the Linux OS team that manages Akamai's custom Linux operating system, which runs on their massively distributed customer-facing network.
Read more about Gregory Boyce

View More author details
Right arrow

Defining commands


The commands that you may use for a given service need to be defined as well. The commands are defined within /etc/nagios-plugins/config, which is also included by /etc/nagios3/nagios.cfg.

This is a useful place to look if you want to see how an existing command is defined, or if you want to define your own custom command.

How to do it…

Let's create a custom command that uses an existing plugin to monitor a new service. Plex media servers are configured by default to use a web server configured on port 32400. So let's define a check_plex service that uses check_http on port 32400.

To do this, we're going to create /etc/nagios-plugins/config/plex.cfg:

define command{
        command_name    check_plex
        command_line    /usr/lib/nagios/plugins/check_http -H '$HOSTADDRESS$' -I '$HOSTADDRESS$' -p 32400 '$ARG1$'
        }

How it works…

Command definitions are simple. You provide a command name and then the command you're going to execute on the local box in order to collect data...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Linux Networking Cookbook
Published in: Jun 2016Publisher: ISBN-13: 9781785287916

Authors (2)

author image
Gregory Boyce

Gregory Boyce is a technologist with nearly 20 years' experience using and managing Linux systems. When he's not at work or spending time with his wife and two daughters, he plays around with new technologies. Gregory has spent the last 15 years working at Akamai Technologies, where he has worked in roles ranging from Network Operations, Internal IT, Information Security, Software Testing, and Professional Services. Currently, he heads up the Linux OS team that manages Akamai's custom Linux operating system, which runs on their massively distributed customer-facing network.
Read more about Gregory Boyce