Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_mediawiki_version
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
NAME
check_mediawiki_version - check if mediawiki software is up to date
VERSION
This documentation refers to version 0.1
USAGE
check_mediawiki_version -H http://www.example.com [-v true] [-n
netlocation -r realm -u username -p password
REQUIRED ARGUMENTS
-H|--hostname web address of site hosting the mediawiki site;
OPTIONS
-H|--hostname web address of site hosting the mediawiki site;
-n|--netloc hostname:port combination for webserver dns hostname. *NO*
protocol (no http:// in it), just a simple or fully qualified name plus
the port number.
-r|--realm authentication realm; this is case sensitive.
-u|--username
-p|--password
-v|--verbose standard this setting is 'false'. If 'true', then one can
see extra debugging info of the http request;
-h|--help this text;
DESCRIPTION
Nagios check to monitor if the mediawiki software version on a site is
the latest production version of the mediawiki distribution.
The check compares the x-meta-generator header of the GET http request
and compares its result to the download link name in the mediawiki.org
site.
When using this check for password protected sites (those where the
webserver sends a 401 answer code and a pop up browser window requests
us to enter a username/password combination), we need to enter in fact
four arguments: the netloc, username, password and realm.
The netloc (this is the name the libwww gives it) is a string formed by
a combination of the dns hostname followed by ':' and then by a number.
The number represents the port used by the webserver, usually 80. So the
netloc for the site http://www.example.com would be www.example.com:80,
without the http:// part which refers to the web protocol.
For the other 3 arguments (realm, username and password) please refer to
http://en.wikipedia.org/wiki/Basic_access_authentication
DIAGNOSTICS
This check can fail because of network problems (no connectivity to the
internet to check the mediawiki.org version, for instance). Use the
--verbose true parameter to get better information if it fails.
This check does not (yet) work behind a proxy server. Patches welcome!
CONFIGURATION AND ENVIRONMENT
Place the plugin in the plugin directory of the nagios server (usually,
/usr/local/nagios/libexec/), make the nagios user its owner and change
the permissions to 775.
DEPENDENCIES
This plugin requires the WWW::Mechanize module. This is a very common
module, so chances are it is already installed on your system.
On a (recent) Redhat based system, you can install it using yum if you
enable the repoforge yum repository:
# yum install perl-WWW-Mechanize
On a debian based system the package is called libwww-mechanize-perl and
you use apt-get so:
# apt-get install libwww-mechanize-perl
On other flavours of unix, check your package manager documentation or
use something like perlbrew or, as a last resort, the cpan shell, to
install it.
INCOMPATIBILITIES
None known yet.
BUGS AND LIMITATIONS
This check assumes that the download link of the mediawiki.org site is
and that the mediawiki sites
will continue to use an x-meta-generator header with the version used by
the sites. If those things change, the plugin will fail miserably.
AUTHOR
()
LICENCE AND COPYRIGHT
This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself. See perldoc perlartistic.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
check_mediawiki_version - check if mediawiki software is up to date
VERSION
This documentation refers to
USAGE
check_mediawiki_version -H http://www.example.com [-v true] [-n
netlocation -r realm -u username -p password
REQUIRED ARGUMENTS
-H|--hostname web address of site hosting the mediawiki site;
OPTIONS
-H|--hostname web address of site hosting the mediawiki site;
-n|--netloc hostname:port combination for webserver dns hostname. *NO*
protocol (no http:// in it), just a simple or fully qualified name plus
the port number.
-r|--realm authentication realm; this is case sensitive.
-u|--username
-p|--password
-v|--verbose standard this setting is 'false'. If 'true', then one can
see extra debugging info of the http request;
-h|--help this text;
DESCRIPTION
Nagios check to monitor if the mediawiki software version on a site is
the latest production version of the mediawiki distribution.
The check compares the x-meta-generator header of the GET http request
and compares its result to the download link name in the mediawiki.org
site.
When using this check for password protected sites (those where the
webserver sends a 401 answer code and a pop up browser window requests
us to enter a username/password combination), we need to enter in fact
four arguments: the netloc, username, password and realm.
The netloc (this is the name the libwww gives it) is a string formed by
a combination of the dns hostname followed by ':' and then by a number.
The number represents the port used by the webserver, usually 80. So the
netloc for the site http://www.example.com would be www.example.com:80,
without the http:// part which refers to the web protocol.
For the other 3 arguments (realm, username and password) please refer to
http://en.wikipedia.org/wiki/Basic_access_authentication
DIAGNOSTICS
This check can fail because of network problems (no connectivity to the
internet to check the mediawiki.org version, for instance). Use the
--verbose true parameter to get better information if it fails.
This check does not (yet) work behind a proxy server. Patches welcome!
CONFIGURATION AND ENVIRONMENT
Place the plugin in the plugin directory of the nagios server (usually,
/usr/local/nagios/libexec/), make the nagios user its owner and change
the permissions to 775.
DEPENDENCIES
This plugin requires the WWW::Mechanize module. This is a very common
module, so chances are it is already installed on your system.
On a (recent) Redhat based system, you can install it using yum if you
enable the repoforge yum repository:
# yum install perl-WWW-Mechanize
On a debian based system the package is called libwww-mechanize-perl and
you use apt-get so:
# apt-get install libwww-mechanize-perl
On other flavours of unix, check your package manager documentation or
use something like perlbrew or, as a last resort, the cpan shell, to
install it.
INCOMPATIBILITIES
None known yet.
BUGS AND LIMITATIONS
This check assumes that the download link of the mediawiki.org site is
will continue to use an x-meta-generator header with the version used by
the sites. If those things change, the plugin will fail miserably.
AUTHOR
LICENCE AND COPYRIGHT
This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself. See perldoc perlartistic.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Reviews (2)
bydaiviermarquez, July 6, 2022
Besides changing the protocol form http to https in the following part of the script:
my $mw_dl_url = "https://www.mediawiki.org/wiki/Download";
There must be added an elsif to handle the change from tar.gz to zip in the format available for download, like this:
if ( $latest_url =~ m/.*mediawiki-(.*).tar.gz/ ) {
$mw_latest_version = $1;
}
elsif ( $latest_url =~ m/.*mediawiki-(.*).zip/ ) {
$mw_latest_version = $1;
}
my $mw_dl_url = "https://www.mediawiki.org/wiki/Download";
There must be added an elsif to handle the change from tar.gz to zip in the format available for download, like this:
if ( $latest_url =~ m/.*mediawiki-(.*).tar.gz/ ) {
$mw_latest_version = $1;
}
elsif ( $latest_url =~ m/.*mediawiki-(.*).zip/ ) {
$mw_latest_version = $1;
}
Great plugin, works as expected.
Just an FYI, media wiki has updated their download page to use SSL, so the code needs to be updated and another dependency added.
This part needs to be updated to use HTTPS instead of HTTP:
# url download mediawiki software
my $mw_dl_url = "https://www.mediawiki.org/wiki/Download";
also I am using Ubuntu and needed to install a dependency in order to get the new https site to load.
"apt-get install libcrypt-ssleay-perl" should do it.
Just an FYI, media wiki has updated their download page to use SSL, so the code needs to be updated and another dependency added.
This part needs to be updated to use HTTPS instead of HTTP:
# url download mediawiki software
my $mw_dl_url = "https://www.mediawiki.org/wiki/Download";
also I am using Ubuntu and needed to install a dependency in order to get the new https site to load.
"apt-get install libcrypt-ssleay-perl" should do it.