User Tools

Site Tools


monitoring:nagios_tips

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
monitoring:nagios_tips [2021/01/01 21:25]
127.0.0.1 external edit
monitoring:nagios_tips [2023/01/18 13:03] (current)
manu
Line 1: Line 1:
 +==== Check_nrpe with SSL or not =====
 +
 +Check if commands can run with SSL
 +<cli prompt='#'>​
 +[root@nagios linux]# /​usr/​lib64/​nagios/​plugins/​check_nrpe -H lnx081 ​ -c check_fs
 +OK
 +</​cli>​
 +
 +Which on lnxb080 looks like this in config ​
 +<​cli>​check_lnx_nrpe!check_fs </​cli>​
 +
 +Because this is a command shortcut for the command above see command.cfg
 +
 +Or without:
 +<cli prompt='#'>​
 +[root@nagios linux]# /​usr/​lib64/​nagios/​plugins/​check_nrpe -H lnx081 -n -c check_fs
 +CHECK_NRPE: Receive header underflow - only -1 bytes received (4 expected).
 +</​cli>​
 +
 +Which on nagios looks like this in config <​cli>​check_lnx_param_nossl_nrpe!check_fs </​cli>​
 +Because this is a command shortcut for the command above see command.cfg
 +
 +The same command exists for commands with parameters e.g. check-disk
 +
 +VI commands to remove all _nossl_nrpe checks:
 +<​code>​
 +[ESC]+:​s/​check_lnx_nossl_nrpe/​check_lnx_nrpe/​g
 +
 +[ESC]+:​s/​check_lnx_param_nossl_nrpe/​check_lnx_param_nrpe/​g
 +</​code>​
 +
 +nossl :
 +<cli>
 +command_name ​   check_lnx_param_nossl_nrpe
 +check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$
 +</​cli>​
 +<cli prompt='#'>​
 +[root@nagios linux]# /​usr/​lib64/​nagios/​plugins/​check_nrpe -H nagios -n -c check_disk -a 20% 35% /
 +</​cli>​
 +
 +ssl:
 +<cli>
 +command_name ​   check_lnx_param_nrpe
 +check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
 +</​cli>​
 +
 +Other example
 +<cli prompt='#'>​
 +[root@nagios linux]# /​usr/​lib64/​nagios/​plugins/​check_nrpe -H lnx033 ​  -c check_procs -a '-w 500 -c 700 -s RSZDT'
 +PROCS CRITICAL: 126 processes with STATE = RSZDT | procs=126;​-w;​-s;​0;​
 +[root@nagios linux]# /​usr/​lib64/​nagios/​plugins/​check_nrpe -H lnx033 ​ -n -c check_procs -a '-w 500 -c 700 -s RSZDT'
 +CHECK_NRPE: Receive header underflow - only -1 bytes received (4 expected).
 +</​cli>​
 +
 +When playing with these configurations on the nagios server don't forget to reload nagios:
 +But before reloading check if the configurations are ok by launching:
 +<cli>
 +nagios -v /​etc/​nagios/​nagios.cfg
 +</​cli>​
 +Then:
 +<cli>
 +systemctl reload nagios.service
 +</​cli>​
 +
 +==== Check_nrpe with parameter =====
 +
 +Server:
 +  Change check_nrpe!check_users!15!20 to check_nrpe!check_users!"​15 20"
 +
  
 ==== Multiple performance values ==== ==== Multiple performance values ====
  
 +When you develop a custom check, ​
 it is possible to send more than one variable in a check. Simply seperated your variable definitions by a pipe symbol (do not use spaces). Here is an example output of a check sending three performance values: it is possible to send more than one variable in a check. Simply seperated your variable definitions by a pipe symbol (do not use spaces). Here is an example output of a check sending three performance values:
 <cli> <cli>
monitoring/nagios_tips.1609532713.txt.gz · Last modified: 2021/01/01 21:25 by 127.0.0.1