PostFix mail queue monitoring
PostFix mail queue monitoring
Hello Team,
I am working on monitoring the Mail queue for Linux server.
I have downloaded the postfix mail queue monitoring plugin. Its working fine on the remote server with sudo
[[email protected] plugins]# sudo /usr/lib64/nagios/plugins/check_postfix_queue -w 20 -c 40
Number of queued messages: 6
without sudo if I check I have to use " -f '!MAILER-DAEMON'"
[[email protected] plugins]# ./check_postfix_queue -w 50 -c 100 -f '!MAILER-DAEMON'. Not sure if this result is correct
Number of queued messages: 0
And on Nagios server, with NRPE I am not getting the results
[root@NagiosXI libexec]# ./check_nrpe -H 10.161.232.60 -c check_postfix_queue
NRPE: Command 'check_postfix_queue' not defined
on the webconsole I have entered the command.. Please check whats actually wrong
I am working on monitoring the Mail queue for Linux server.
I have downloaded the postfix mail queue monitoring plugin. Its working fine on the remote server with sudo
[[email protected] plugins]# sudo /usr/lib64/nagios/plugins/check_postfix_queue -w 20 -c 40
Number of queued messages: 6
without sudo if I check I have to use " -f '!MAILER-DAEMON'"
[[email protected] plugins]# ./check_postfix_queue -w 50 -c 100 -f '!MAILER-DAEMON'. Not sure if this result is correct
Number of queued messages: 0
And on Nagios server, with NRPE I am not getting the results
[root@NagiosXI libexec]# ./check_nrpe -H 10.161.232.60 -c check_postfix_queue
NRPE: Command 'check_postfix_queue' not defined
on the webconsole I have entered the command.. Please check whats actually wrong
You do not have the required permissions to view the files attached to this post.
Re: PostFix mail queue monitoring
NRPE is saying the command is not defined because the command likely does not exist in the remote machine's NRPE configuration set. The -c argument for check_nrpe is telling the remote NRPE agent that you wish to call its check_postfix_queue command. The check_postfix_queue command will need to exist in the remote machine's NRPE configuration (usually in /usr/local/nagios/etc/nrpe.cfg). It might look something like this:
Code: Select all
command[check_postfix_queue]=/usr/lib64/nagios/plugins/check_postfix_queue -w 20 -c 40Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: PostFix mail queue monitoring
even after defining the command on the remote server I am getting attached error.
You do not have the required permissions to view the files attached to this post.
Re: PostFix mail queue monitoring
It looks like your Nagios XI command definition for "check_postfix_queue" has a space after it:
Can you try removing that space from either the Command's "Command Name" or the Service's "Check Command"?
Can you try removing that space from either the Command's "Command Name" or the Service's "Check Command"?
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: PostFix mail queue monitoring
I am getting the results on CLI
But on webconsole, not giving me any result
I checked with Nagios user, I get the result on CLI, But not when I add the service to the host on webconsole.
My service definition -
define service {
host_name xx.xx.xx.xx
service_description PostFix queue monitoring_mailq
check_command check_nrpe!check_postfix_queue!-a w -100 -c 600!!!!!!
initial_state u
max_check_attempts 3
check_interval 5
retry_interval 5
check_period 24x7
notification_period 24x7
notification_options w,c,u,r,f,s,
register 1
}
But on webconsole, not giving me any result
I checked with Nagios user, I get the result on CLI, But not when I add the service to the host on webconsole.
My service definition -
define service {
host_name xx.xx.xx.xx
service_description PostFix queue monitoring_mailq
check_command check_nrpe!check_postfix_queue!-a w -100 -c 600!!!!!!
initial_state u
max_check_attempts 3
check_interval 5
retry_interval 5
check_period 24x7
notification_period 24x7
notification_options w,c,u,r,f,s,
register 1
}
You do not have the required permissions to view the files attached to this post.
Re: PostFix mail queue monitoring
Can you send us the full contents of your check_postfix_queue script?
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: PostFix mail queue monitoring
Hi,
PFA.. Thanks. i havent used .sh extension on the plugin
PFA.. Thanks. i havent used .sh extension on the plugin
You do not have the required permissions to view the files attached to this post.
Re: PostFix mail queue monitoring
Hmm, I haven't been able to reproduce this particular issue using that script.
On my remote machine:
On my XI machine:
Though I think the problem is that your Nagios XI configuration isn't lining up with your NRPE configuration. In Nagios XI you have this:
With the $ARG2$ value being -a w -100 -c 600. This doesn't line up with what you have configured in the remote machine's NRPE:
Where no arguments are expected for this command at all. Try revising your check like so:
And see if that gives meaningful output.
On my remote machine:
Code: Select all
[root@localhost libexec]# ./check_postfix_queue.sh -w 100 -c 200
Number of queued messages: 200
...
# in nrpe.cfg
command[check_postfix_queue]=/usr/local/nagios/libexec/check_postfix_queue.sh -w 100 -c 200
Code: Select all
[root@xi-stable ~]# /usr/local/nagios/libexec/check_nrpe -H 192.168.67.97 -c check_postfix_queue
Number of queued messages: 200Code: Select all
check_command check_nrpe!check_postfix_queue!-a w -100 -c 600!!!!!!Code: Select all
command[check_postfix_queue]=/usr/lib64/nagios/plugins/check_postfix_queue -w 20 -c 40Code: Select all
check_command check_nrpe!check_postfix_queueYou do not have the required permissions to view the files attached to this post.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: PostFix mail queue monitoring
cool.. This worked.
Thanks for the help.
Kindly close this case
Thanks for the help.
Kindly close this case