How to change nagios alert format into json format

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

How to change nagios alert format into json format

Postby gouravin » Fri Mar 22, 2019 6:37 am

Hi Team,

This is my first question on forum. Just started working on Nagios and I want to change format of alert email to json format. Currently it is coming as plain text, Can anyone please help me to change text to json format as per below sample.

{
"nagios_alert": {
"server_name": "Nagios Master Production",
"app_name": " PEMS",
"service_name": " nscp",
"host": " localhost",
"state": " WARNING",
"last_state": " WARNING",
"check_attempt": " 4",
"max_check_attempt": "4",
"state_since": " 0d 0h 7m 0s",
"is_downtime": " 0",
"service_last_ok": "1551277516",
"service_check_output_short": " PROCS WARNING: 271 processes with STATE = RSZDT ",
"service_check_output_long": " ",
"notification_type": " PROBLEM",
"date_time": " Wed Feb 27 14:32:16 UTC 2019",
"additional_info": "PROCS WARNING: 271 processes with STATE = RSZDT"
}
}


Thanks in advance for the help :)
gouravin
 
Posts: 8
Joined: Thu Feb 14, 2019 1:03 am

Re: How to change nagios alert format into json format

Postby benjaminsmith » Fri Mar 22, 2019 1:57 pm

Closing this topic as it's a duplicate ( see this ).
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!
User avatar
benjaminsmith
 
Posts: 2720
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul


Return to Community Support

Who is online

Users browsing this forum: johnwcos and 3 guests