Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds.
A user is required to query the OS Linux by SSH. There is no need for root or sudo privileges.
There are two possible ways to perform SSH check, either by exchanging the SSH key from centreon-engine to the target server,
or by setting your unique user and password directly in the host macros.
SSH keys exchange
User/Password Authentication
Add and generate a password for your user on the Target sever:
adduser ro_ssh_centreon passwd ro_ssh_centreon
Switch to centreon-engine's bash environment on your Central server and Poller :
su - centreon-engine
Then, copy this key on to the Target server with the following commands:
ssh-keygen -t ed25519 -a 100 ssh-copy-id -i .ssh/id_ed25519.pub ro_ssh_centreon@<IP_TARGET_SERVER>
After setting the Name, Alias, IP, and Host Template parameters, you need to set up in the macros described in the Configuration part below.
Add a new Host and apply the Os-Linux-SSH-custom Host Template.
Once the template set, you have to set values according to the chosen SSH backend.
3 SSH backends are available to connect to the Linux server: sshcli, plink and libssh which are detailed below.
How to check in the CLI that the configuration is OK and what are the main options for ?β
Once the Plugin installed, log into your poller using the centreon-engine user account and test by running the following command :
/usr/lib/centreon/plugins//centreon_linux_ssh.pl \ --plugin=os::linux::local::plugin \ --mode='cpu'\ --hostname='10.30.2.114'\ --ssh-backend='libssh'\ --ssh-username='myuser'\ --ssh-password='mypassword'\ --ssh-port='22'\ --warning-core='60'\ --critical-core='70'\ --warning-average='60'\ --critical-average='75'\ --verbose \ --use-new-perfdata OK: CPU(s) average usage is 11.91 % - CPU '0' usage :11.91 % | 'cpu.utilization.percentage'=11.91%;;;0;100'0#core.cpu.utilization.percentage'=11.91%;;;0;100 CPU '0' usage :11.91 %
The check command gives the average CPU of a device using SSH (--mode=CPU).
It uses a SSH username centreon (--ssh-username=centreon), a SSH password centreon-password (--ssh-password='centreon-password'),
uses a SSH backend libssh (--ssh-backend='libssh') and it connects to the host 10.30.2.114 (--hostname=10.30.2.114)
on the SSH default port 22 (---ssh-port=22).
This command will trigger a WARNING alarm if the CPU Average increases to more than 60% (--warning-average='60')
and a CRITICAL alarm if more than 75% (--critical-average='75').
Thresholds can be set on all of the device metrics using the syntax --warning-*metric* --critical-*metric*.
All the options that can be used with this plugin can be found over the --help command: