zenoss / ZenPacks.zenoss.RabbitMQ

RabbitMQ Monitoring for Zenoss
GNU General Public License v2.0
10 stars 9 forks source link

Modeler doesn't use zCommandPath #5

Closed ju55i closed 12 years ago

ju55i commented 12 years ago

I'm running the zenpack with RabbitMQ 2.2.0 on RHEL5. Rabbitmqctl command is run as a rabbitmq user on the server. Zenpack provides data to the device graphs correctly but doesn't populate the components. When running command manually on the RabbitMQ server data comes out just fine.

When running zenmodeler manually I see in the logs: 2012-02-08 11:53:32,416 DEBUG zen.SshClient: x.x.x.x channel 1 CommandChannel exit code for rabbitmqctl status 2>&1 && (echo COMMAND ; for vhost in $(rabbitmqctl -q list_vhosts) ; do echo "VHOST: $vhost" ; echo "SPLIT" ; rabbitmqctl -q list_exchanges -p $vhost name type durable auto_delete arguments ; echo "SPLIT" ; rabbitmqctl -q list_queues -p $vhost name durable auto_delete arguments ; echo "VHOST" ; done) is 127: Command not found

I guess it can't find the rabbitmqctl command. It is located in /usr/sbin and I've set that path to zCommandPath. I don't wish to access the RabbitMQ server as a root. How can I get the path right?

ju55i commented 12 years ago

I got this solved by setting the /usr/sbin path in rabbitmq user's bashrc-file. It would be great though if the modeler would honor the zCommandPath property.

cluther commented 12 years ago

I like the bashrc solution. Another option would be to change the command in the RabbitMQ monitoring templates to include the path to the command.

Using zCommandPath is troublesome because you could very well be running multiple commands against the same server over SSH that live in different paths. zCommandPath was really intended to point to the local path of Nagios plugins on the Zenoss server before we even had the ability to execute commands over SSH.

Thanks for the report, and for the workaround.

reagle710 commented 12 years ago

ju55i, you are ssh'in into the server using rabbitmq user? Or are you loggin into the server with another non-root account? Do you know if there is way to just run the rabbitmq plugin with rabbitmq user and all other plugins as another user? Any help would be appreciated. --rob

ju55i commented 12 years ago

I used the rabbitmq user. Rest of the monitoring is done through snmp. I think it is not possible to use multiple ssh users in zenoss with a single device.

reagle710 commented 12 years ago

Did you have to set the password for the rabbitmq user? Don't remember ever setting one during installation? --Rob

ju55i commented 12 years ago

I used SSH keys. Just drop the public key to rabiitmq-users .ssh-directory (/var/lib/rabbitmq in RHEL5) and set the private key in zenoss.