Coder Social home page Coder Social logo

nagios-wordpress-update's Introduction

Nagios-WordPress-Update

A Nagios plugin to check for WordPress version updates on a remote server without the use of NRPE.

Nagios Exchange

How to use:

  • Upload wp-version.php to your WordPress root installation
  • Include the IP address of your Nagios installation in the script
  • Copy check_wp_update to your Nagios plugins folder. For me, it's on /usr/lib64/nagios/plugins
  • Create a service command template
  • Create a service check on your host

Command Template

define command{
        command_name    check_wp_update
        command_line    $USER1$/check_wp_update $ARG1$
        }

Service Check

define service{
        use                     generic-service
        host_name               example.com
        service_description     My WordPress Install
        check_command           check_wp_update!http://example.com/wp-version.php
        }

Inspired by check_wp_version by @hteske. Original here

nagios-wordpress-update's People

Contributors

b4dschk4pp avatar fredbradley avatar jinjie avatar josef-friedrich avatar kinamo avatar paulchen avatar svenkuegler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nagios-wordpress-update's Issues

Status does not change when updates get applied

I just installed your plugin and it's working great against a site that's already up to date. It reports 'OK' status for a site that was installed yesterday.

Where I'm seeing trouble is when the plugin detects updates need applied. The plugin correctly notices the Core, Plugin, and Theme updates that needed updating on another site... but once these components are updated, the wp-version.php routine never reflects that things are actually up to date.

I have hit the '/wp-admin/update-core.php?force-check=1' url multiple times following my site updates, and it's reflecting that everything is current and up to date, but the plugin still is returning CRITICAL stating that all the updates are still required.

Is there some component or cache or something that I'm overlooking to actually clear the status that you're calling?

===
I have done some further testing against another site and if I update just plugins and themes, then the status correctly changes to 'core updates' available... but I'm still faced with a couple sites that are still returning no status change when all components are updated.

Progress meter of curl in output

When I execute the check I get the progress meter output of curl in the output for whatever reason. Fixed it by adding the -s (silent) parameter to CURL_OPTS.

image

System: Ubuntu 18.04.3 Server

WordPress -

Hi,

I have copied the wp-version.php to the root directory where the WordPress installation is and the main plugin to my Nagios plugins directory.

When I am running the plugin from the Nagios server I am getting this:

WORDPRESS -

Do you have an idea why this might be?

Thank you,

Kind regards,
Sergiu

PHP warning from wp-config.php

I see these errors appear in my nginx-errorlog after every check:

"PHP message: PHP Warning: Invalid argument supplied for foreach() in /var/www/www.example.com/wp-version.php on line 53" while reading response header from upstream [...]

It's line 53 but line 52 in the code, since I added one line with the allowed_ips.
PHP is version 5.5.9
Any idea?

Does not work on HTTP/2 Protocol

The return code has changed on HTTP/2.

Instead of having "HTTP/1.1 200 OK" for a successful connection, it returns "HTTP/2 200".

So this check here below always fails:
if [[ $response != *"200 OK"* ]]; then

Changing this line to this below fixed the problem for me:
if [[ ( $response != *"200 OK"* && $response != *"HTTP/2 200"* ) ]]; then

Could it detect headers, so returns critical if wp-version.php not found

I'm getting an 'OK' message when this check is run on Wordpress installs where the wp-version.php has yet to be installed.

It would be good to put an extra check so that if anything other than a 200 header response came back it would return critical.

Example use case: Developer wanting to know if end user has deleted their version checker script! Or if a virus has got in a removed the file.

Parameterized version of check_wp_update

Hi there,

I forked this script to make a version that accepts the various parts of the WordPress URL separately with arguments.

I'm not sure how useful this is to you - you'd have to modify your CheckCommand and service definitions to take advantage - and I think it's only helpful if you're using Icinga2. However, the advantage if you ARE using Icinga2 is that you can add: vars.cms = "wordpress" and Icinga will add the check based on existing data in the host definition.

Anyway - check it out - if it's not helpful to you, no worries! If it is, let me know and I'll do a PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.