By Jesse Morgan
So, on CentOS 6.x, I get the following warning when trying to use check_twill:
[jmorgan@in1c6ut002:~]$ /usr/lib64/nagios/plugins/check_twill
/usr/lib/python2.6/site-packages/twill/other_packages/_mechanize_dist/_auth.py:14: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
import re, base64, urlparse, posixpath, hashlib, sha, sys, copy
Sorry, check_twill requires 1 option
check_twill 1.2 (twill version 0.9)
This plugin executes a twill script and returns results for Nagios.
It is designed to be a simple method to funtionally test websites.
(see http://twill.idyll.org for more info on writing twill scripts)
Usage: check_twill [-f|-v] <path_to_twill_script>
Options:
-h, --help
Print detailed help screen
-V, --version
Print version information
-f, --file
Path to twill script
-v, --verbose
Shows details for command-line debugging (Nagios may truncate)
Examples:
$ check_twill -f /tmp/success.tw
PAGE CHECK OK - All tests passed successfully |available=1 totalTime=0.308099
$ check_twill -f /tmp/failure.tw
PAGE CHECK CRITICAL - Failed on [code is 404 != 200 ] on line 2 at \
http://foo.example.com |available=0 totalTime=0.784899
</path_to_twill_script>
The proper fix is to change line 14 of /usr/lib/python2.6/site-packages/twill/other_packages/_mechanize_dist/_auth.py to replace “md5, sha” with hashlib:
import re, base64, urlparse, posixpath, hashlib, sys, copy
Adding this here so I can find it later. I should probably file a bug report with rpmforge.