yum install nagios-plugins-all
sudo apt install nagios-plugins
vi /opt/librenms/config.php
: # nagios-plugins-all $config['show_services'] = 1; $config['nagios_plugins'] = "/usr/lib64/nagios/plugins";
chmod +x /usr/lib64/nagios/plugins/*
vi /opt/librenms/config.php
: # nagios-plugins $config['show_services'] = 1; $config['nagios_plugins'] = "/usr/lib/nagios/plugins";
chmod +x /usr/lib/nagios/plugins/*
vi /etc/cron.d/librenms
: */5 * * * * librenms /opt/librenms/services-wrapper.py 1 # Daily maintenance script. DO NOT DISABLE! :
service crond restart
systemctl restart cron
cd /usr/lib64/nagios/plugins/ ./check_ssmtp --help
./check_http -H www.ichiayi.com --ssl -C 30,10 SSL OK - Certificate 'www.ichiayi.com' will expire in 79 days on 2019-06-14 23:34 +0800/CST. ./check_http -H svn.ichiayi.com --ssl -C 30,10 SSL OK - Certificate 'www.ichiayi.com' will expire in 79 days on 2019-06-14 23:34 +0800/CST.
所以看到 svn.ichiayi.com 回應出來的結果會出現 www.ichiayi.com , 這問題可以增加 –sni 參數來解決
./check_http -H www.ichiayi.com --ssl --sni -C 30,10 SSL OK - Certificate 'www.ichiayi.com' will expire in 79 days on 2019-06-14 23:34 +0800/CST. ./check_http -H svn.ichiayi.com --ssl --sni -C 30,10 SSL WARNING - Certificate 'svn.ichiayi.com' expires in 29 day(s) (2019-04-26 15:26 +0800/CST).
--sni -S
HTTP OK: HTTP/1.1 200 OK - 1073685 bytes in 0.536 second response time