- Nagios Network Monitoring
- General Information and TidBits
- Installation Tips & Tricks
- Addons, Plugins, Tweaks & Customizations
- Checking Drupal Status with Nagios and WebInject
- AddOn - NRPE / NSClient
- AddOn - Nagios Event Log aka NagEventLog
- Addon - Nagios Passive Checks with NSCA
- Nagios Custom Object Variables
- Nagios Event Handler - Restart Remote Service
- Nagios Event Handler - Restarting a Local Service
- Plugin: check_dns_secondary - Checking NS Servers
- Plugin: check_http_requisites - Page Size, Files, and Loadtime
- Plugin: check_mem - Linux Memory Usage
- Plugin: check_sql - Check MSSQL and MYSQL servers
- Plugin: check_svn - Check Subversion
- Tweak - Nagios Jabber / XMPP Notifications
- Tweak - Nagios SMS Messaging
- Tweak - check_file_age to check_file_modified
- Tweak: Using NagiosGraph's SHOW.CGI
- Tweak: check_sql - Allow decimal values
- Common Errors & Fixes
Checking Drupal Status with Nagios and WebInject
Summary
A few weeks back I found a post on the Drupal forums about monitoring the status report page with Nagios and Webinject. Having lots of practice with Nagios and Webinject, I knew this was possible but noone had provided an example. So I finally got around to creating the Webinject script today and posted it. Below is the complete process including the Nagios info I used.
Webinect XML Script
<testcases repeat="1">
<testvar varname="BASE_URL">http://www.domain.com/</testvar>
<testvar varname="LOGIN1">username</testvar>
<testvar varname="PASSWD1">password</testvar>
<case
id="1"
description1="Connecting to Login Page"
method="get"
url="${BASE_URL}?q=user"
verifypositive="Enter the password that accompanies your username"
errormessage="Unable to load login page"
/>
<case
id="2"
description1="Authentication"
method="post"
url="${BASE_URL}?q=user"
postbody="name=${LOGIN1}&pass=${PASSWD1}&form_id=user_login&op=Log+in"
verifypositive="${BASE_URL}\?q=users/${LOGIN1}"
errormessage="Login Post Problem"
/>
<case
id="3"
description1="Status Report Page"
method="get"
url="${BASE_URL}?q=admin/reports/status"
verifynegative="Out of date"
verifypositive="Drupal core update status"
errormessage="Status Page Alert!"
/>
</testcases>
Nagios Command File Entry
define command {
command_name webinject
command_line /usr/local/nagios/webinject/webinject.pl -c nagios/$ARG1$ nagios/$ARG2$
}
Nagios Check Entry
define service {
use template1
host_name server
service_description status-report
check_command webinject!nagios.xml!drupal_status.xml
}
Thoughts
The webinject script looks for something that is "Out of date" on the Status Report and will alert appropriately based on your Nagios configuration. The first step is not necessarily required, but it helps in troubleshooting if the login page for the site is not loading correctly and preventing the check from executing correctly.
- MWalker's blog
- Printer-friendly version
- Login or register to post comments
-

Recent comments
7 weeks 3 days ago
24 weeks 6 days ago
28 weeks 5 hours ago
37 weeks 6 days ago
45 weeks 2 days ago
45 weeks 4 days ago
50 weeks 1 day ago
1 year 1 week ago