Page 1 of 1

Formatting the output from ncpa agent

Posted: Fri Jul 03, 2020 2:09 am
by lilydalehs
Hi All,

with a fresh install of 5.7.1 I'm looking to migrate to ncpa agent from the previous nsclient++

With my existing installation, I monitor the total CPU usage of my VM's on a server using the following command

Code: Select all

/usr/local/nagios/libexec/check_nt -H ${Host} -s ${PW} -p 12489 -v COUNTER -l "\Hyper-V Hypervisor Logical Processor(_Total)\% Total Run Time","VM CPU Usage is %.1f" -w 70 -c 85
this returns a nice string of

Code: Select all

VM CPU Usage is 8.0
I got the same check happening with ncpa using the command

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H 1server.curric.lilydale-hs.wan -t 'mytoken' -P 5693 -M 'windowscounters/Hyper-V Hypervisor Logical Processor(_Total)/% Total Run Time' -q sleep=1
However, this returns the very long and quite ugly

Code: Select all

OK: \Hyper-V Hypervisor Logical Processor(_Total)\% Total Run Time was 14.86 % Total Run Time
and also uses the long string Hyper-V Hypervisor Logical Processor(_Total)\% Total Run Time as the legend on the graphs. Is there any way of adding a "label" of sorts to the ncpa command like I could with the check_nt command?

Thanks in advance,
Chris.

Re: Formatting the output from ncpa agent

Posted: Mon Jul 06, 2020 2:32 pm
by benjaminsmith
Hi Chris,

Thanks for the feedback on NCPA. I would recommend opening an enhancement request for this on the GitHub repository for NCPA. Your request is similar to the following but it looks like you would like to see a different format for the Information Text in this case.

Feature request - add option for custom label and unit #629

As a workaround, it's possible alter the check command output using a script, but the output would have to adhere to the Nagios plugin specifications so it can be read by Nagios

https://nagios-plugins.org/doc/guidelines.html

Let us know if you have any questions.

Benjamin