Page 1 of 1

CHECK_KVM Plugin

Posted: Tue Jun 14, 2016 3:26 pm
by Berto
Hello,

I'm having a slight issue with the check_kvm plugin. I created a new command in Nagios called check_kvm and in the command line I put the following line;
$USER1$/check_kvm

Then in services I created a new service for check_kvm and when I use the Test command button I get the following output;

COMMAND: /usr/local/nagios/libexec/check_kvm
OUTPUT: Unknown guests

When I go to the server and run the command locally as root it displays properly. So I tried running the command locally as nagios user and I do get the same output 'unknown guests' but if I run the command as nagios again but this time like;

sudo /usr/local/nagios/libexec/check_kvm it displays properly.

Since this is my first try at this, I'm wondering if I'm doing something wrong in the interface when creating the command or am I defining the service wrong?

--Berto

Re: CHECK_KVM Plugin

Posted: Tue Jun 14, 2016 4:38 pm
by tgriep
Some plugins may need to run as root to function and when they are run from Nagios XI, they are ran as the nagios user so that is why you are receiving the error.
You could define your command like below

Code: Select all

sudo $USER1$/check_kvm
But I found this on the exchange site which could work for you also.
No sudo is necessary if you simply add nagios user to the libvirt group

Re: CHECK_KVM Plugin

Posted: Thu Jun 16, 2016 10:39 am
by Berto
I will give both a try and let you know if one of those fixed my issue.

Re: CHECK_KVM Plugin

Posted: Thu Jun 16, 2016 11:35 am
by tgriep
Keep us in the loop.