Page 1 of 1

NCPA: How to get more info via email?

Posted: Sat Mar 30, 2019 4:22 am
by realtebo
I have a server which every days, at a different hour, has a spike of cpu % usage.

I am interesting on the output of this api

Code: Select all

/api/processes?cpu_percent=10&check=true&warning=2&critical=3
Which can result into something like

Code: Select all

{
    "perfdata": "'process_count'=1;2;3;",
    "returncode": 0,
    "stdout": "OK: Process count for cpu usage greater than 1.00 was 1 | 'process_count'=10;2;3; 'cpu'=6.5%;;; 'memory'=1.04%;;; 'memory_vms'=0.24GB;;; 'memory_rss'=0.04GB;;;\nProcesses Matched\nPID: Name: Username: Exe: Memory: CPU\n-----------------------------------\n27244: ncpa_listener: nagios: 10.04 % (VMS 0.24 GB, RSS 0.04 GB): 6.50 %\n\nTotal Memory: 1.04 % (VMS 0.24 GB, RSS 0.04 GB)\nTotal CPU: 6.50 %\n"
}
The problem is the email contains only

Code: Select all

OK: Process count for cpu usage greater than 1.00 was 1 | 'process_count'=10;2;3; '
I have no idea of what to modify

Re: NCPA: How to get more info via email?

Posted: Mon Apr 01, 2019 10:16 am
by scottwilkerson
You want to include the $LONGSERVICEOUTPUT$ macro in your service notification commands
$LONGSERVICEOUTPUT$ The full text output (aside from the first line) from the last service check.
https://assets.nagios.com/downloads/nag ... viceoutput