Nagios 4.4.6 macros $SERVICEOUTPUT$ problem
Posted: Tue Nov 19, 2024 12:27 pm
Just migrated to new version of nagios from old lovely 3.x nagios
All works fine but i have a problem with notification macros $SERVICEOUTPUT$ when checking port state with check_snmp and only if port is down (SNMP CRITICAL - *2*)
I'm using custom owncoded script for telegram notification
/usr/lib/nagios/plugins/telegram.sh $CONTACTPAGER$ "$NOTIFICATIONTYPE$ Service: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ Info:$SERVICEOUTPUT$"
Here is what nagios write on debug log
Here what is come to telegram
But if i use /usr/lib/nagios/plugins/telegram.sh 296519911 "PROBLEM Service: Somewhere OLT/6. Pinger 220V is CRITICAL Info:SNMP CRITICAL - *2*" from console - it's send proper notification.
And this is only when SNMP CRITICAL, when SNMP OK - 1 - it's send correct notification.
What is the problem with $SERVICEOUTPUT$ ?
All works fine but i have a problem with notification macros $SERVICEOUTPUT$ when checking port state with check_snmp and only if port is down (SNMP CRITICAL - *2*)
I'm using custom owncoded script for telegram notification
/usr/lib/nagios/plugins/telegram.sh $CONTACTPAGER$ "$NOTIFICATIONTYPE$ Service: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ Info:$SERVICEOUTPUT$"
Here is what nagios write on debug log
Code: Select all
[1732035790.356306] [032.2] [pid=3737799] ** Notifying contact 'Pavel'
[1732035790.356312] [032.2] [pid=3737799] Raw notification command: /usr/lib/nagios/plugins/telegram.sh $CONTACTPAGER$ "$NOTIFICATIONTYPE$ Service: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ Info:$SERVICEOUTPUT$"
[1732035790.356317] [032.2] [pid=3737799] Processed notification command: /usr/lib/nagios/plugins/telegram.sh 296519911 "PROBLEM Service: Somewhere OLT/6. Pinger 220V is CRITICAL Info:SNMP CRITICAL - *2*"
Code: Select all
PROBLEM Service: Somewhere OLT/6. Pinger 220V is CRITICAL Info:SNMP CRITICAL - systemd-private-0bbec17acdc0463492d5e5f71c04556f-apache2.service-eYHFKX systemd-private-0bbec17acdc0463492d5e5f71c04556f-systemd-logind.service-tzPUK7
And this is only when SNMP CRITICAL, when SNMP OK - 1 - it's send correct notification.
What is the problem with $SERVICEOUTPUT$ ?