Application Help Postfix, Apache, OS update

I am trying to get the Postfix and Apache Applications working on Ubuntu and Cent7.
And OS Update on Arch Linux.

Postfix on Cent7 when running postfixdetailed I just get all 0 0 0 0 0 0 0 but vertical.
Postfix on Ubuntu I get a message Can’t open /var/log/maillog: No such file or directory at /usr/sbin/pflogsumm line 623.
with 0 0 0 0 0 0 vertically following. /var/log/maillog exist.

For Apache I have an error on Cent7

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

For OS Updates, Cent 7 and ubutnu work fine but on Arch linux when running os-updates.sh it doesnt return anything.

Please help
Thank You

Hi, how you solved this ? I have this issue too

I didnt, I only got it working on ubuntu

Open the postfixdetailed file and change /var/log/maillog to /var/log/mail.log
I also changed the $pflogsumm= variable so it includes the sudo command.

$pflogsumm=‘/usr/bin/env /usr/bin/sudo /usr/sbin/pflogsumm’;

And added this code to a sudoers file;

snmp ALL=(ALL) NOPASSWD: /usr/sbin/pflogsumm /var/log/mail.log

Maybe you need to change the first word “snmp” to the username your snmp deamon runs on.

For postfix-queues i’ve edited the file to include the sudo command;

COUNT=sudo /usr/sbin/qshape $i | grep TOTAL | awk '{print $2}'

And added this to a sudoers file

snmp ALL=(ALL) NOPASSWD: /usr/sbin/qshape incoming
snmp ALL=(ALL) NOPASSWD: /usr/sbin/qshape active
snmp ALL=(ALL) NOPASSWD: /usr/sbin/qshape deferred
snmp ALL=(ALL) NOPASSWD: /usr/sbin/qshape hold

Please note that you need to restart the snmp daemon so the sudoers permissions are set.

For apache you need to enable the status mod;

a2enmod status

Hi HomeServ,

i have changed postfix-queues and postixdetailed, but I dont know what you mean when are you typing about suedors file. Where Can I find this file.

Thank you.

Create a file in /etc/sudoers.d
The files in this directory will be included automatically by sudo.
In my setup, I use /etc/sudoers.d/snmp

Thank you. Now is POSTFIX working for me.

Hi I’m struggling with this as when I put sudo in my config then I’m unable to poll the service and without sudo I get access denied

Without sudo rights

"Can’t cd to incoming: Permission denied
at /usr/sbin/qshape line 375.

Can’t cd to active: Permission denied
at /usr/sbin/qshape line 375.

Can’t cd to deferred: Permission denied
at /usr/sbin/qshape line 375."

With Sudo Rights

Timeout: No Response from udp:172.16.xx.xx:161 SNMP[‘/usr/bin/snmpbulkwalk’ ‘-v2c’ ‘-c’ ‘COMMUNITY’ ‘-Oqv’ ‘-M’ ‘/opt/librenms/mibs:/opt/librenms/mibs/supermicro:/opt/librenms/mibs/dell’ dp:HOSTNAME:161’ ‘.1.3.6.1.4.1.8072.1.3.2.3.1.2.15.112.111.115.116.102.105.120.100.101.116.97.105.108.101.100’]

Timeout: No Response from udp:172.16.xx.xx:161 RRD[update /mnt/data-01/rrd/172.16.xx.xx/app-postfix-6.rrd N:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U] SQL[UPDATE `applications` set `app_state`=?,`app_status`=?,`timestamp`=NOW(),`app_state_prev`=? WHERE pp_id` = ? [“UNKNOWN”,“”,“OK”,6] 231.67ms]

As what user does snmpd runs?
Have you created the sudoers file and restarted the snmpd process so the sudoers file is loaded?

1 Like

yes I figured out that I get timeout soo I changed config.php giving it more time and its working now.