Page 1 of 1

check_nagios_mailq not working

Posted: Tue Aug 24, 2021 8:18 am
by pavan509
Hello Team,

I am getting the below error in Nagiosxi portal for the service emailq which is using the plugin "check_nagios_mailq.py".

==========================================================================================================
(No output on stdout) stderr: Traceback (most recent call last):
File "/usr/local/nagios/libexec/check_nagios_mailq.py", line 46, in
main()
File "/usr/local/nagios/libexec/check_nagios_mailq.py", line 34, in main
outb = int (outb)
ValueError: invalid literal for int() with base 10: 'Program mode requires special privileges, e.g., root or TrustedUser.'
==========================================================================================================

I have followed the https://support.nagios.com/forum/viewto ... lq#p272409 link to verify my issue but couldn't resolve it. Below are the output details based on the information provided in the link.
==========================================================================================================
ls -l /usr/bin/mailq
lrwxrwxrwx 1 root root 27 Aug 20 03:14 /usr/bin/mailq -> /etc/alternatives/mta-mailq

ls -l /etc/alternatives/mta-mailq
lrwxrwxrwx 1 root root 23 Aug 20 03:14 /etc/alternatives/mta-mailq -> /usr/bin/mailq.sendmail

ls -l /usr/bin/mailq.sendmail
lrwxrwxrwx 1 root root 25 Aug 20 03:13 /usr/bin/mailq.sendmail -> ../sbin/sendmail.sendmail
==========================================================================================================

Nagios server is running on RHEL 7.9 in AWS with postfix service running
==========================================================================================================
service postfix status
Redirecting to /bin/systemctl status postfix.service
● postfix.service - Postfix Mail Transport Agent
Loaded: loaded (/usr/lib/systemd/system/postfix.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2021-08-24 05:48:03 PDT; 28min ago
Process: 16839 ExecStop=/usr/sbin/postfix stop (code=exited, status=0/SUCCESS)
==========================================================================================================

Can someone help me in resolving this issue?

Re: check_nagios_mailq not working

Posted: Tue Aug 24, 2021 1:54 pm
by dchurch
I can't find a copy of check_nagios_mailq.py as installed by default in Nagios XI. Is this a custom script? What version of Nagios XI are you running?

Have you tried using /usr/local/nagios/libexec/check_mailq? This plugin ships with Nagios XI and is likely better-supported.

Re: check_nagios_mailq not working

Posted: Tue Sep 28, 2021 10:17 am
by pavan509
Hello @dchurch,

Sorry for the delayed response. The issue had been fixed by myself after modifying the script further.

Kindly close/lock this post

Re: check_nagios_mailq not working

Posted: Tue Sep 28, 2021 4:46 pm
by pbroste
Thanks, Pavan will close