Hi
Typically what is done is that you create your own plugin and then call it using check_ncpa.py
The plugin is essentially some sort of script.
Image001.jpg
The above is taken from
https://www.nagios.org/ncpa/help.php#ac ... tive-check
Here is some documentation on plugins:
https://assets.nagios.com/downloads/nag ... ugins.html
https://assets.nagios.com/downloads/nag ... inapi.html
https://nagios-plugins.org/doc/guidelines.html
On the client running ncpa their is a config file called ncpa.cfg This file has an area for plugin definition, so you could associate the ruby command with an .rb file extension, and also list commands that should be run using sudo. Here is a section of that cfg file:
Code: Select all
# This is for Unix only (Linux, Mac OS X, etc)
#
# run_with_sudo =
#
# Extensions for plugins
# ----------------------
# The extension for the plugin denotes how NCPA will try to run the plugin. Use this
# for setting how you want to run the plugin in the command line.
#
# NOTE: Plugins without an extension will be ran in the cmdline as follows:
# $plugin_name $plugin_args
#
# Defaults:
# .sh = /bin/sh $plugin_name $plugin_args
# .py = python3 $plugin_name $plugin_args
# .pl = perl $plugin_name $plugin_args
# .php = php $plugin_name $plugin_args
# .ps1 = powershell -ExecutionPolicy Bypass -File $plugin_name $plugin_args
# .vbs = cscript $plugin_name $plugin_args //NoLogo
# .wsf = cscript $plugin_name $plugin_args //NoLogo
# .bat = cmd /c $plugin_name $plugin_args
#
# Since windows NCPA is 32-bit, if you need to use 64-bit powershell, try the following for
# the powershell plugin definition:
# .ps1 = c:\windows\sysnative\windowspowershell\v1.0\powershell.exe -ExecutionPolicy Unrestricted -File $plugin_name $plugin_args
#
# Linux / Mac OS X
.sh = /bin/sh $plugin_name $plugin_args
.py = python3 $plugin_name $plugin_args
.pl = perl $plugin_name $plugin_args
.php = php $plugin_name $plugin_args
# Windows
.ps1 = powershell -ExecutionPolicy Bypass -File $plugin_name $plugin_args
.vbs = cscript $plugin_name $plugin_args //NoLogo
.wsf = cscript $plugin_name $plugin_args //NoLogo
.bat = cmd /c $plugin_name $plugin_args
The above gives a pretty good background of creating plugins and using check_ncpa.py to run the plugins.
Another good resource is
https://exchange.nagios.org/ where there are over 4000 plugins
created by users. Nagios Exchange is a central place for Nagios Community members and contributors to find and
share Nagios projects of all kinds - plugins, addons, documentation, extensions and more.
Thanks
You do not have the required permissions to view the files attached to this post.