NCPA custom plugins scripts and configuration
Posted: Sun Mar 14, 2021 9:22 am
Hi,
I started working with NCPA because NRPE is not supported anymore and I have a few issues with it's deployment and configuration.
I have linux machines (Ubuntu 16.04/18.08) with python3, bash and perl custom scripts.
I copied them into /usr/local/ncpa/plugins dir to be custom scripts.
I don't know how to add the new commands to NCPA cfg file and grant to some of them root privileges.
A few examples from what I did in nrpe.cfg:
Suders file:
My questions are:
1. How can I add the commands and sudoers to new NCPA configuration (ncpa.cfg) with the privileges that I need?
2. Almost all my scripts are in python 3.5+. Dose it matter for NCPA when running the scripts?
I have on my machines NCPA 2.3.1
Nagios XI - 5.8.2 with check_ncpa.py, Version 1.2.4
All the checks are need to active and not passive.
Thank you!
I started working with NCPA because NRPE is not supported anymore and I have a few issues with it's deployment and configuration.
I have linux machines (Ubuntu 16.04/18.08) with python3, bash and perl custom scripts.
I copied them into /usr/local/ncpa/plugins dir to be custom scripts.
I don't know how to add the new commands to NCPA cfg file and grant to some of them root privileges.
A few examples from what I did in nrpe.cfg:
Code: Select all
command[myscript]=sudo -S /usr/local/nagios/libexec/myscript.py
command[myscript2]=sudo -S -u root /usr/local/nagios/libexec/myscript2.py
command[myscript3]=/usr/local/nagios/libexec/myscript3.py
command[myscript4]=/usr/local/nagios/libexec/myscript4.pl
command[myscript5]=sudo -S /usr/local/nagios/libexec/myscript5Code: Select all
nagios ALL=NOPASSWD: /usr/local/nagios/libexec/myscript.py
nagios ALL=(root) NOPASSWD: /usr/local/nagios/libexec/myscript2.py
1. How can I add the commands and sudoers to new NCPA configuration (ncpa.cfg) with the privileges that I need?
2. Almost all my scripts are in python 3.5+. Dose it matter for NCPA when running the scripts?
I have on my machines NCPA 2.3.1
Nagios XI - 5.8.2 with check_ncpa.py, Version 1.2.4
All the checks are need to active and not passive.
Thank you!