Error with /etc/snmp/apache-stats.py

When i run this /etc/snmp/apache-stats.py, I was getting this error:

Traceback (most recent call last):
File “/etc/snmp/apache-stats.py”, line 37, in
data = urlread ( ‘http://localhost/server-status?auto’,user_agent = ‘SNMP Apache Stats’ )
File “/usr/lib/python2.7/dist-packages/urlgrabber/grabber.py”, line 775, in urlread
return default_grabber.urlread(url, limit, **kwargs)
File “/usr/lib/python2.7/dist-packages/urlgrabber/grabber.py”, line 1236, in urlread
s = self._retry(opts, retryfunc, url, limit)
File “/usr/lib/python2.7/dist-packages/urlgrabber/grabber.py”, line 1086, in _retry
r = apply(func, (opts,) + args, {})
File “/usr/lib/python2.7/dist-packages/urlgrabber/grabber.py”, line 1219, in retryfunc
fo = PyCurlFileObject(url, filename=None, opts=opts)
File “/usr/lib/python2.7/dist-packages/urlgrabber/grabber.py”, line 1283, in init
self._do_open()
File “/usr/lib/python2.7/dist-packages/urlgrabber/grabber.py”, line 1619, in _do_open
self._do_grab()
File “/usr/lib/python2.7/dist-packages/urlgrabber/grabber.py”, line 1757, in _do_grab
raise e
urlgrabber.grabber.URLGrabError: [Errno 14] HTTP Error 404 - Not Found.

i have the next config apache httpd.conf

ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from localhost
Allow from 127.0.0 ::1
Allow from IP public

Seems like you have something missconfigured in your apache as is returning 404 Not Found.

where can I check the log?

Did you enabled mod_status in your apache?

Where I enable mod status?, Is ExtendedStatus On?

try checking that you can get to the mod_status page from localhost.

If using cli you can use links or wget.

In ubuntu -> sudo a2enmod status

In CentOS -> Edit /etc/httpd/conf/httpd.conf

Find and uncomment the line

#LoadModule status_module modules/mod_status.so

A post was split to a new topic: Apache2 stats basic auth