{{tag>nagios php debian troubleshooting}}
====== Nagios troubleshooting ======
===== Nagios not working after Debian upgrade? =====
Apache is probably not executing php files properly.
Make sure the apache modules are enabled. Screenshots of error:
Firefox (something probably cached from before)
{{:wiki:screenshots:nagios_php.png|}}
Chrome fresh navigation to page
{{:wiki:screenshots:nagios_php2.png|}}
Run:
a2enmod php7.3
List of modules that should be enabled
# apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
cgi_module (shared)
cgid_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
filter_module (shared)
mime_module (shared)
mpm_prefork_module (shared)
negotiation_module (shared)
php7_module (shared)
reqtimeout_module (shared)
rewrite_module (shared)
setenvif_module (shared)
status_module (shared)
==== Debian 11 ====
apt install libapache2-mod-php7.4
==== Debian 12 ====
apt install php8.2-fpm libapache2-mod-php8.2 &&
a2enmod php8.2 proxy_fcgi setenvif &&
a2enconf php8.2-fpm
==== Tested on ====
* Debian 10 (after upgrade from Debian 9)
* Debian 12 (after upgrade from Debian 10 -> 11)
===== nagiosgraph js problem =====
When accessing graphs in url nagiosdomain.com/nagiosgraph/cgi-bin/showhost.cgi?host=localhost you get an error
JavaScript is disabled.
nagiosgraph.js is not installed or wrong version.
The issue could be in rrd filename (///usr/local/nagiosgraph/var/rrd//) encoding the '"' character as "%22" which confuses javascript. Example of filename
Check%20www.karl.com___%7C%20isAlreadySelected%28panel%2C%20selectedValue%29%3B%5Cn%20%20%7D%22%20on%20https%3A%2F%2Fwww.karl.com%2Fde%2Fmantel_cod59141927re.html%20%7CRAUVX.rrd
Simply remove the offending file and reload nagios.
==== Tested on ====
* nagios 4.2.2
* nagiosgraph 1.5.2
* Debian GNU/Linux 11 (bullseye)
===== CHECK_NRPE: (ssl_err != 5) Error - Could not complete SSL handshake with =====
Make sure you are using an up to date nrpe plugins.
==== Tested on ====
* Debian 10 (after upgrade from Debian 9)
===== Cannot get interface speed using highperf mib : UNKNOWN =====
Add to ''check_if_traffic'' -g2 flag:
check_if_traffic!22!localhost!public!eth0!0,50000!0,75000!-Y -B -k -g2 --label
===== Settings not applied after restart =====
For example if changing whether or not notifications will be sent, nagios by default [[https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/configmain.html#use_retained_program_state|remembers state]] even after restart, so for [[https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/configmain.html#enable_notifications|notifications]] you will need to change it manually in ///usr/local/nagios/var/retention.dat//.
You could also remove this file (but first stop nagios and make a backup!) which will force reread of all configs and schedule the check for all hosts and services, so make sure you want this.
===== undefined reference to `get_dh2048' nrpe =====
Happened when trying to make install nrpe version 3.2.0 on Debian 12. Used version nrpe 4.1.0.and problem went away.
===== Cannot write to pidfile '/var/run/nrpe.pid' - check your privileges. =====
Check the pid in nrpe.cfg and the nrpe.service file, The paths should match there.
~# grep pid /usr/local/nagios/etc/nrpe.cfg
pid_file=/var/run/nrpe.pid
systemctl cat nrpe
# /lib/systemd/system/nrpe.service
[Unit]
Description=Nagios Remote Plugin Executor
Documentation=http://www.nagios.org/documentation
After=var-run.mount nss-lookup.target network.target local-fs.target time-sync.target
Before=getty@tty1.service plymouth-quit.service xdm.service
Conflicts=nrpe.socket
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
Restart=on-abort
PIDFile=/usr/local/nagios/var/nrpe.pid <<--- THIS
Here the fix was to update the nrpe.cfg with the path from systemd file.
====== See also ======
* [[wiki:icinga_troubleshooting|Icinga troubleshooting]]
====== References ======
* https://www.techrepublic.com/article/how-to-fix-apache-2-not-executing-php-files/
* https://support.nagios.com/forum/viewtopic.php?f=7&t=40351&p=205190#p205190
* https://serverfault.com/questions/805616/cannot-get-interface-speed-with-standard-mib-use-highperf-mib-g
* https://nagios.force.com/support/s/article/Understanding-retention-dat-and-modified-attributes-b41690d9?