CHECK_KVM Plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

CHECK_KVM Plugin

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: CHECK_KVM Plugin

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Berto
Posts: 162
Joined: Tue Jul 01, 2014 6:12 pm

Re: CHECK_KVM Plugin

Post by Berto »

I will give both a try and let you know if one of those fixed my issue.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: CHECK_KVM Plugin

Post by tgriep »

Keep us in the loop.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked