NCPA: How to get more info via email?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
realtebo
Posts: 19
Joined: Tue Nov 28, 2017 3:56 am

NCPA: How to get more info via email?

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked