Formatting the output from ncpa agent

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
lilydalehs
Posts: 34
Joined: Fri May 29, 2020 7:20 pm

Formatting the output from ncpa agent

Post 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.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Formatting the output from ncpa agent

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked