I've been trying to setup a Nagios plugin via ssh to alert and graph a postfix 
mailq.  I created a zenoss user on the remote server and also configured a ssh 
rsa key so that the zenoss user on my zenoss server can login to the remote 
postfix server without a password.  I setup the zproperties within zenoss on 
the device hosting postfix as follows:

zCommandPath: /usr/bin
zCommandUsername: zenoss
zKeyPath: ~/.ssh/id_rsa   (because I'm using rsa, not dsa)

I then copied "check_mailq" from /usr/local/zenoss/common/libexec on the zenoss 
server to /usr/bin on the postfix server.  I can run it on the remote server as 
the zenoss user:


Code:
$ /usr/bin/check_mailq -Mpostfix -w 200 -c 400
OK: mailq (59) is below threshold (200/400)|unsent=59;200;400;0



I then copied the "Device" template for that server as a local template so I 
could modify it.  I created a new "Command" data source called "check_mailq" 
with the following properties:

Name: check_mailq
Source Type: COMMAND
Enabled: True
Use SSH: True
Component: Postfix
Event Class: /Cmd/Ok
Event Key:
Severity: Warning
Cycle Time: 60
Command Template: check_mailq -Mpostfix -w 200 -c 400

I created a DataPoint as follows:

Name: check_mailq
Type: Guage

The rest is blank.  Then I created a Graph Definition

Name: Postfix
Units: Messages Queued

the rest is default.  I then added the check_mailq_check_mailq "Data Point" as 
a "Graph Point" and left everything default.   

The problem is that the graph is not showing anything under the "Perf" tab.  It 
just shows the Postfix heading and the left and right arrows for the graph.  It 
doesn't even show my units "Messages Queued".  I'm not sure what I need to do 
to get the returned values from this nagios plugin to graph.  

Most of the documentation I've followed is from here: 
http://www.zenoss.com/community/docs/howtos/create-modify-nagios-templates   I 
can run "zencommand run -d DEVICENAME -v10" and it shows the zenoss server 
logging into the remote postfix server as the user zenoss.  It also shows the 
output of the check_mailq command:


> DEBUG:zen.SshClient:creating new ssh connection
> DEBUG:zen.SshClient:attempting to authenticate using username: zenoss
> DEBUG:zen.SshClient:Getting Public Key from ~/.ssh/id_rsa
> DEBUG:zen.SshClient:Getting Private Key from ~/.ssh/id_rsa
> INFO:zen.SshClient:connected to device DEVICENAME
> DEBUG:zen.SshClient:opening command channel for /usr/bin/check_mailq 
> -Mpostfix -w 200 -c 400
> DEBUG:zen.SshClient:running command remotely: exec /usr/bin/check_mailq 
> -Mpostfix -w 200 -c 400
> DEBUG:zen.SshClient:command /usr/bin/check_mailq -Mpostfix -w 200 -c 400 
> data: 'OK: mailq (56) is below threshold (200/400)|unsent=56;200;400;0\n'
> DEBUG:zen.zencommand:Process check_mailq -Mpostfix -w 200 -c 400  stopped 
> (0), 0.604117 elapsed
> DEBUG:zen.zencommand:The result of "/usr/bin/check_mailq -Mpostfix -w 200 -c 
> 400" was "OK: mailq (56) is below threshold (200/400)|unsent=56;200;400;0


So everything *appears* ok.  But I'm not sure what I need to do to get this 
info to graph.  Any ideas?




-------------------- m2f --------------------

Read this topic online here:
http://community.zenoss.com/forums/viewtopic.php?p=22246#22246

-------------------- m2f --------------------



_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to