Advertisement
Guest User

Nagios check for Joomla (modifications)

a guest
Sep 30th, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.27 KB | None | 0 0
  1. --- check_joomla_version.php    2014-09-30 13:45:25.464600000 -0500
  2. +++ check_joomla_version.php    2014-09-30 14:19:21.257705500 -0500
  3. @@ -25,6 +25,13 @@
  4.   ***/
  5.  $localVersionFile = "/var/www/joomla/libraries/cms/version/version.php";
  6.  $remoteVersionUrl = "http://update.joomla.org/core/list.xml";
  7. +
  8. +// Define the base path.
  9. +// http://developer.joomla.org/manual/ch01s02.html
  10. +//
  11. +// JPATH_PLATFORM - The path to the Joomla Platform (where loader.php or
  12. +// platform.php is located, usually in the same folder as import.php).
  13. +define('JPATH_PLATFORM', '/var/www/libraries');
  14.  
  15.  
  16.  // get local Joomla Version
  17. @@ -36,7 +43,16 @@
  18.  
  19.  // get remote Joomla Version
  20.  $xml = simplexml_load_file($remoteVersionUrl);
  21. -$remoteJoomlaVersion = $xml->extension['version'];
  22. +
  23. +// Think ppr from Python - it prints out the structure
  24. +//print_r($xml);
  25. +
  26. +// Evidently the XML feed lists additional supported versions
  27. +// since the script was originally written. The first matching array
  28. +// is no longer the version we're interested in checking against.
  29. +// Now we want to grab the version element from the last extension array.
  30. +$extension_array_count = count($xml->extension);
  31. +$remoteJoomlaVersion = $xml->extension[$extension_array_count-1]['version'];
  32.  
  33.  
  34.  // compare and return info
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement