Abstract
This document describes how you can monitor a Linux server Over a SSH connexion. This pack monitors main ressources on a server such as:
- Kernel ressources
- Memory ressources
- Network ressources
- Disk Ressources
- SSH monitor
- NTP status
Introduction
This pack is designed to retreive data over SSH. The Shinken poller service needs to connect over SSH to the remote host. During the Shinken installation, the installer script creates a shinken user on the server hosting the Poller.
The Linux pack uses this user to execute remote commands. The authentication to the remote host is passwordless (managed by an authentication key). The remote user does not need to have specific rights on the system.
SSH Connexion configuration
Client Side
Create a local Shinken system user with homedir and password
adduser -m -r shinken passwd shinken
Poller server Side
- Connect to server as the Shinken user and deploy key:
[root@shinken-poller ~]# su - shinken [shinken@shinken-poller ~]# ssh-copy-id remote_host The authenticity of host '192.168.1.19 (192.168.1.19)' can't be established. RSA key fingerprint is 00:ff:ee:dd:cc:bb:aa:d6:d3:79:1d:f6:93:47:80:27. Are you sure you want to continue connecting (yes/no)? yes shinken@remote_host's password: XXXXXXXXXXX Now try logging into the machine, with "ssh '192.168.1.19'", and check in: .ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting. ssh shinken@remote_host -i .ssh/id_rsa
How to use the linux pack
The linux pack can be used by applying the linux host template to a host. This can be done by two different ways:
Using the Configuration UI
In the Configuration UI, simply create or edit a Host, and add the linux template in the Host Templates field by using the selector.
Using Cfg files
In a Cfg file of your choice, create a host and set the use property to linux.
The Cfg file must then be imported into Shinken Enterprise using a source (more information on the associated documentation page: Shinken cfg file Import).
Common issues
- NTPd is in Unknown State
- Install and configure ntp service
- Reboot is in Critical State
- Default critical value for this check is 3600
- CPUstat is in Unknown State
- install sysstat package
Check summary
| Check Name | Description | value range | default Warning | default Critical |
| |
|---|---|---|---|---|---|---|
| 1 | CPU Stats | Get CPU information through "mpstat" command | 0-100 | > 80 | > 90 | |
| 2 | Disks | Get DISKS information through "df" command | 0-100 | > 90 | > 95 | |
| 3 | Disks stats | Get DISKS STATS information from /proc | 0-n | N/A | N/A | |
| 4 | Kernel stats | Get kernel informations from /proc/vmstat | 0-n | N/A | N/A | |
| 5 | Load Average | Get system load information from /proc/loadavg | 0-n,0-n,0-n | > "1.5,1.5,1.5" | > "3,3,3" | |
| 6 | Memory | Get Memory information from "free" command | 0-100 | > 90 | > 95 | |
| 7 | NET Stats | Get network statistics from /proc/net/dev | 0-n | N/A | N/A | |
| 8 | NFS Stats | Get NFSd statistics from /proc/net/rpc/nfsd | 0-n | N/A | N/A | |
| 9 | NTPSync | Get timedelta with ntp server | 0-n | > 40 | > 60 | |
| 10 | Read-only Filesystems | Test if a FS is in Read-only state or not | 0-1 | N/A | = 1 | |
| 11 | Uptime | Get server uptime from "uptime" command | 0-n | N/A | < 3600 | |
| 12 | SSH connexions | Check if a SSH connexion is possible | 0-1 | N/A | = 0 | |
| 13 | TCP states | Get TCP counts by States | 0-n | N/A | N/A |
Customize Warning or Critical thresholds
The linux pack defines default Warning and Critical thresholds for checks.
Customize a single host
Checks from linux packs often provide data that can be changed to customize thresholds.
To change thresholds on one particular host, the most simple way is to change these datas on the host directly.
- This can be done via the Configuration UI, in the Data tab.
For example, changing the CPU_CRIT data to 60 will set the Warning threshold of the CPU Stats check to 60 - Alternatively, this can also be done via Cfg files.
To change the CPU_CRIT data, edit the host and set _HOSTCPU_CRIT.
Customize all hosts using the linux pack
To change all hosts using the linux template, the best idea would seem to be to edit the linux host template directly and set datas.
However, on the next Shinken Enterprise update, these templates can be modified, resulting in a behaviour change and possibly break your configuration.
The best practice is to clone the elements involved in the linux pack and rename them. Then, they can be modified without any risks related to the Shinken Enterprise update process.
The cloned linux pack can then be modified and personalized according to your needs.
For example, in order to change default thresholds, edit your cloned linux host template and edit datas, as described in the previous section.