Using wpnagios.php

 

 

 

This is called using Check_MK's MRPE helper:

 

# cat /etc/mrpe.cfg
Updates_Wordpress_deranfangvomen.de /usr/local/bin/wpnagios.php --dir /var/www/sites/floh/deranfangvomen.de/subdomains/www/html/wordpress/
Updates_Wordpress_amanderenen.de /usr/local/bin/wpnagios.php --dir /var/www/sites/flex/amanderenen.de/subdomains/www/html/wp
Updates_Wordpress_florianheigl.me /usr/local/bin/wpnagios.php --dir /var/www/sites/flex/florianheigl.me/subdomains/www/html/wp

 

 

 

Inventory on the server:

OMD[remotely]:~$ cmk -I xen50.xenvms.de
mrpe              1 new checks
OMD[remotely]:~$ cmk -D xen50.xenvms.de | grep -i wordpress
  mysql_check     floh_wordpress                      ()                                                                                                                                Database floh_wordpress                                        
  mysql_check     wordpress                           ()                                                                                                                                Database wordpress                                             
  mrpe            Updates_Wordpress_amanderenen.de    None                                                                                                                              Updates_Wordpress_amanderenen.de                               
  mrpe            Updates_Wordpress_deranfangvomen.de None                                                                                                                              Updates_Wordpress_deranfangvomen.de                            
  mrpe            Updates_Wordpress_florianheigl.me   None                                                                                                                              Updates_Wordpress_florianheigl.me                       

 

Test it:

OMD[remotely]:~$ cmk -v xen50.xenvms.de 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
Updates_Wordpress_amanderenen.de Well done! Core is up-to-date. - Plugins are up-to-date. - Themes are up-to-date.
Updates_Wordpress_deranfangvomen.de Need attention! Core is up-to-date. - 1 plugin is out-of-date! - Themes are up-to-date.
Updates_Wordpress_florianheigl.me 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.