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 NameDescriptionvalue rangedefault Warningdefault Critical

 

1CPU StatsGet CPU information through "mpstat" command0-100> 80> 90 
2DisksGet DISKS information through "df" command0-100> 90> 95 
3Disks statsGet DISKS STATS information from /proc0-nN/AN/A 
4Kernel statsGet kernel informations from /proc/vmstat0-nN/AN/A 
5Load AverageGet system load information from /proc/loadavg0-n,0-n,0-n> "1.5,1.5,1.5"> "3,3,3" 
6MemoryGet Memory information from "free" command0-100> 90> 95 
7NET StatsGet network statistics from /proc/net/dev 0-nN/A

N/A

 
8NFS StatsGet NFSd statistics from /proc/net/rpc/nfsd0-nN/A

N/A

 
9NTPSyncGet timedelta with ntp server0-n> 40> 60 
10Read-only FilesystemsTest if a FS is in Read-only state or not0-1N/A= 1 
11UptimeGet server uptime from "uptime" command0-nN/A< 3600 
12SSH connexionsCheck if a SSH connexion is possible0-1N/A= 0 
13TCP statesGet TCP counts by States0-nN/AN/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.

  • No labels