Populating $LONGSERVICEOUTPUT$ into PagerDuty integration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Populating $LONGSERVICEOUTPUT$ into PagerDuty integratio

Post by scottwilkerson »

It is worth pointing out that $LONGSERVICEOUTPUT$ only contains the data AFTER the first line out output

If you want the full output you likely want to do something like this:

Code: Select all

/usr/share/pdagent-integrations/bin/pd-nagios -n service -k $CONTACTPAGER$ -t "$NOTIFICATIONTYPE$" -f SERVICEDESC="$SERVICEDESC$" -f SERVICESTATE="$SERVICESTATE$" -f HOSTNAME="$HOSTNAME$" -f SERVICEOUTPUT="$SERVICEOUTPUT$ $LONGSERVICEOUTPUT$"
This would make SERVICEOUTPUT shown in the JSON you showed contain both $SERVICEOUTPUT$ and $LONGSERVICEOUTPUT$
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Populating $LONGSERVICEOUTPUT$ into PagerDuty integratio

Post by scottwilkerson »

enoc wrote:Amazing! Thank you.
This was exactly what resolved my issue
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked