Book Image

Learning Nagios 3.0

Book Image

Learning Nagios 3.0

Overview of this book

Table of Contents (16 chapters)
Learning Nagios 3.0
Credits
About the Author
About the Reviewer
Preface

Monitoring over SSH


Very often, Nagios is used to monitor computer resources such as CPU utilization, memory, and disk space. One way in which this can be done is to connect over SSH and run a Nagios check plugin.

This requires setting up SSH to authenticate using public keys. This works so that Nagios server has an SSH private key, and the target machine is configured to allow users with that particular key to connect without prompting them for password.

Nagios offers a plugin, check_by_ssh, that takes the host name and the actual command to run on the remote server. It then connects using SSH, runs the plugin, and returns both output and exit code from the actual check performed on the remote machine to Nagios running on the local server. Internally, it runs SSH client to connect to it and runs the actual command to run along with its attributes. After the check has been performed, the output, along with the check command's exit code, is passed back to Nagios.

Thanks to this, regular plugins...