RPi 4B 2GB
NEMS Linux 1.5.2
I'm working on a check_ script in PHP to get health info from my UniFi controller. It uses the PHP class documented at
https://github.com/Art-of-WiFi/UniFi-API-client
to talk to the UniFi web API. It's written with reference to J. Hoerter's work on a generic use of this,
https://www.jhoerter.com/download/check_unifi-php.html
my usage is very specific, though. I have it working to my satisfaction invoked from the command line in my account on the NEMS server.
My problem now is how to install it as a plugin. These are the files involved:
check_unifi_health.php - my script
requires check_settings.php - my settings
requires check_unifi.php - the API client class installed vi PHP Composer in a Vendor subdir
I've figured out that /usr/local/nagios/libexec is the location of the built-in nagios scripts but putting my files here does not lead to their appearance in the drop-down list of check_ commands in the NEMS configurator. So, something else needs to be done - but what?
Can you help, please?
How do I install my plugin?
Re: How do I install my plugin?
In case it's of use to anyone - Responding to my own question here after finding the answer.
The NConf Import Guide explains what needs to be done:
https://www.nconf.org/wordpress/wp-cont ... -guide.pdf
Essentially, the new check command script, as well as being placed in the plugins directory also has to be registered via add_items_from_nagios.pl in the NConf database. First create a new check command definition in a file e.g. checkcommand-unifi_health.cfg
Then verify expected action using the -s (simulate option)
Look for errors in the output before removing the -s from the command to do it for real.
The NConf Import Guide explains what needs to be done:
https://www.nconf.org/wordpress/wp-cont ... -guide.pdf
Essentially, the new check command script, as well as being placed in the plugins directory also has to be registered via add_items_from_nagios.pl in the NConf database. First create a new check command definition in a file e.g. checkcommand-unifi_health.cfg
Code: Select all
define command {
command_name check_unifi_health
command_line $USER1$/check_unifi_health $ARG1$
}
Code: Select all
sudo /var/www/nconf/bin/add_items_from_nagios.pl -c checkcommand -f ~graeme/check_unifi/checkcommand-health.cfg -s
Re: How do I install my plugin?
Hi,
can you help me a little bit, your self answer leave as much ??? than it answered.
Where and how I have to do this things?
can you help me a little bit, your self answer leave as much ??? than it answered.
Where and how I have to do this things?
-
- Junior Member
- Posts: 1
- Joined: Sat Feb 19, 2022 4:40 am
Re: How do I install my plugin?
Yes really appreciate this post for installing my plugin, which is so realistic and desired for all the new individuals but there are also very grateful to buy guest post service backlinks, which are so delightful and essential in getting the best SEO Services in any form easily.