Getting Data In

webping logging errors

vbumgarn
Path Finder

webping is a lovely little application. It is logging this error with splunk 4.1.x, though. Any plans to update it?

12-02-2010 08:07:19.922 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/webping/bin/webping.py"   import getopt, sys, imaplib, os, urllib2, urlparse, httplib, gzip, md5, \
12-02-2010 08:22:19.929 ERROR ExecProcessor - message from "python /opt/splunk/etc/apps/webping/bin/webping.py" /opt/splunk/etc/apps/webping/bin/webping.py:2: DeprecationWarning: the md5 module is deprecated; use hashlib instead

Thanks.

Tags (1)
0 Karma

southeringtonp
Motivator

That's a pretty common error in Python. If it's the only problem you're having it should be pretty easy to fix yourself.

Based on a very quick look, edit webping.py and make the following changes:

1) In the line of imports in lines 3-4, change md5 to hashlib.

2) At line 107, change it to read:

        if (u.config['indexMD5'] and u.result.has_key('data')):
            s = u.result.get('data')
            h = hashlib.new('md5')
            h.update(s)
            checksum = h.hexdigest()
            print 'ping_md5 =', checksum

A side effect is that you can replace 'md5' with 'sha1' or something else in hashlib.new() if you'd rather use a different hash algorithm.

Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...