Using wpnagios.php




This is called using Check_MK's MRPE helper:


# cat /etc/mrpe.cfg /usr/local/bin/wpnagios.php --dir /var/www/sites/floh/ /usr/local/bin/wpnagios.php --dir /var/www/sites/flex/ /usr/local/bin/wpnagios.php --dir /var/www/sites/flex/




Inventory on the server:

OMD[remotely]:~$ cmk -I
mrpe              1 new checks
OMD[remotely]:~$ cmk -D | grep -i wordpress
  mysql_check     floh_wordpress                      ()                                                                                                                                Database floh_wordpress                                        
  mysql_check     wordpress                           ()                                                                                                                                Database wordpress                                             
  mrpe      None                                                                                                                                                   
  mrpe   None                                                                                                                                                
  mrpe     None                                                                                                                                           


Test it:

OMD[remotely]:~$ cmk -v 2>&1 | grep -i -e wordpress -e check_mk -e "Agent version"
Check_mk version 1.2.0p2
Database floh_wordpress OK - No errors found
Database wordpress   OK - No errors found Well done! Core is up-to-date. - Plugins are up-to-date. - Themes are up-to-date. Need attention! Core is up-to-date. - 1 plugin is out-of-date! - Themes are up-to-date. your installation is way to old or your installation path isn't correct...\nOkay, let me help you... btw. this is version 1.0<br>Valid arguments:<br> --domain DOMAIN check for DOMAIN (required for multidomain installations)<br> --dir DIRECTORY wordpress installation directory can be found in DIRECTORY<br> --web WEBSITE check _only_ the website WEBSITE (will just check the core version for updates, based on meta name generator)<br> --insec-cert don't verify SSL cert (in combination with --web)<br> --no-core don't check the core<br> --no-plugins don't check the plugins<br> --no-theme don't check the themes<br> -h
OK - Agent version 1.2.1i6, execution time 7.7 sec|execution_time=7.680


Make a cronjob that writes mrpe.cfg based on checking for new wordpress installs - use locate for that.