Nwc_health Line wrapping notifications don´t work

Hi everyone,

We are using in our organization the “check_nwc_health” check for our network devices.

We use the “–multiline” option to get a good overview of the output with line breaks. Unfortunately the line wrapping only works in the HTML GUI and doesn´t work in the notfications.
The “–multiline” option puts HTML code in the output, but our notification script don´t use HTML.

Is there any way to solve this?

Hi,

do you have a concrete plugin output and notification example, with additional configuration objects to get a better idea? Maybe a screenshot even.

Cheers,
Michael

Hi,

thank you for your help.

This is the plugin output on the command line:

This is the e-mail output:

Best,
Erwin

Hi,

ok, and can we see the

  • notification script
  • example command line how the notification script is called
  • notification command

The email looks like a custom html notification, not the standard scripts. The culprit might be in there, from the terminal line breaks (\n) to html (<br>) - such a transformation can be done inside a notification script for example.

Cheers,
Michael

Hi,

command for notifications

The director-mail-service-notification-html.sh Script:
director-mail-service-notification-html.txt (3.2 KB)

Thanks,
Erwin

Puh, Bash. I’ve googled for “bash replace newline with br” leading to for example this: https://stackoverflow.com/questions/45145353/replace-n-with-br-in-bash

Put a line somewhere which modifies the $SERVICEOUTPUT variable before you actually use it in the template. Something like this, but I haven’t tested this.

SERVICEOUTPUT= "${SERVICEOUTPUT//$'\n'/<br />}"

Cheers,
Michael

1 Like

That worked for us. Now the notfications look similiar with the output on the command line.

Thank you very much!

Best,
Erwin

1 Like