This is first my question on forum. Just started working on Nagios and We need to change format of alert email to json format. Currently it is coming as plain text, Can anyone please change text to json format as per below sample.
{
"nagios_alert": {
"server_name": "Nagios Master Production",
"app_name": " pepS",
"service_name": " sscp",
"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": "16",
"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