Hello @hbouma
I will test this further and follow up shortly.
Thanks,
Perry
Email of multiline output
Re: Email of multiline output
Hello @hbouma
Imported and loaded up our test VM with your System Profile to test and verify the '$LONGSERVICEOUTPUT$' today.
Review on the configs and logs indicate that the '$LONGSERVICEOUTPUT$' is working on service checks that are specifically scripted to send "HTML" code to the '$LONGSERVICEOUTPUT$' variable.
For example, we see that the following results with '$LONGSERVICEOUTPUT$' from our test VM. We see that the service check failed to connect to my server on port 12489 and the additional line '$LONGSERVICEOUTPUT$'; "could not fetch information from server"
I will also send via [PM] Private Message the attachment with the checks with output to '$LONGSERVICEOUTPUT$'.
This indicates that the '$LONGSERVICEOUTPUT$' is functioning as expected, but again it relies on the Service Check to output additional lines.
Thanks,
Perry
Imported and loaded up our test VM with your System Profile to test and verify the '$LONGSERVICEOUTPUT$' today.
Review on the configs and logs indicate that the '$LONGSERVICEOUTPUT$' is working on service checks that are specifically scripted to send "HTML" code to the '$LONGSERVICEOUTPUT$' variable.
For example, we see that the following results with '$LONGSERVICEOUTPUT$' from our test VM. We see that the service check failed to connect to my server on port 12489 and the additional line '$LONGSERVICEOUTPUT$'; "could not fetch information from server"
[service] => PROC-nrouter
[hoststate] => UP
[hoststateid] => 0
[servicestate] => CRITICAL
[servicestateid] => 2
[lastservicestate] => CRITICAL
[lastservicestateid] => 2
[servicestatetype] => HARD
[currentattempt] => 3
[maxattempts] => 3
[serviceeventid] => 141
[serviceproblemid] => 102
[serviceoutput] => connect to address 127.0.0.1 and port 12489: Connection refused
[longserviceoutput] => could not fetch information from server
I will also send via [PM] Private Message the attachment with the checks with output to '$LONGSERVICEOUTPUT$'.
This indicates that the '$LONGSERVICEOUTPUT$' is functioning as expected, but again it relies on the Service Check to output additional lines.
Thanks,
Perry
Re: Email of multiline output
So, we do insert a new line into the output. When looking at the output in the GUI, it is shown in multiple lines.
Trying to figure out why the Nagios XI GUI would show new lines, but the same output in the email would only show \n instead of an actual new line?
Trying to figure out why the Nagios XI GUI would show new lines, but the same output in the email would only show \n instead of an actual new line?
Re: Email of multiline output
Hello @hbouma
Would you please provide the service check and the screenshot on an example that you see to view what is going on?
Thanks,
Perry
Would you please provide the service check and the screenshot on an example that you see to view what is going on?
Thanks,
Perry
Re: Email of multiline output
Responded in PM as there are email addresses and server names in the response.
Re: Email of multiline output
Hello @hbouma
Thanks for sending over the additional information. I have spun-up a test environment and will continue to test and respond with results.
In testing we see that the eventman logs are giving us additional line information that we are looking for from the PowerShell script. This is the example that we:
Will continue to test and follow up.
Thanks,
Perry
Thanks for sending over the additional information. I have spun-up a test environment and will continue to test and respond with results.
In testing we see that the eventman logs are giving us additional line information that we are looking for from the PowerShell script. This is the example that we:
We know that the results of the PowerShell script are sending the additional information, now trying to figure out if there is any way to get $LONGSERVICEOUTPUT$ to recognize.An email notification will be sent...
Email Notification Data:
Array
(
[meta] => Array
(
[notification-type] => service
[contact] => nagiosadmin
[contactemail] => root@localhost
[type] => PROBLEM
[escalated] => 0
[author] =>
[comments] =>
[host] => 192.168.
[hostaddress] => 192.168.
[hostalias] => 192.168.
[hostdisplayname] => 192.168.
[service] => Plugin check_files.ps1
[hoststate] => UP
[hoststateid] => 0
[servicestate] => CRITICAL
[servicestateid] => 2
[lastservicestate] => CRITICAL
[lastservicestateid] => 2
[servicestatetype] => HARD
[currentattempt] => 1
[maxattempts] => 1
[serviceeventid] => 78
[serviceproblemid] => 40
[serviceoutput] => Files modified in the last 9999 minutes. Files are:
[longserviceoutput] => C:\temp\New Text Document (2) - Copy.txt\nC:\temp\New Text Document (2).txt\nC:\temp\New Text Document (3) - Copy.txt\nC:\temp\New Text Document (4) - Copy.txt\nC:\temp\New Text Document.txt\nC:\temp\stuff - Copy (2).txt\nC:\temp\stuff - Copy (3).txt\nC:\temp\stuff - Copy.txt\nC:\temp\stuff.txt\n\n\t
Will continue to test and follow up.
Thanks,
Perry
Re: Email of multiline output
Hello @hbouma
Following up as I had time to dig into this more today. I was working with a colleague with test VM and found that we were missing a notification message line config.
On the web UI, if you head over to Admin > Notification Messages > [Email tab]
My example:

Let me know how things look,
Perry
Following up as I had time to dig into this more today. I was working with a colleague with test VM and found that we were missing a notification message line config.
On the web UI, if you head over to Admin > Notification Messages > [Email tab]
- Under Alert Message:
- Service Alert Message:
Andyourwordinghere: %longhostoutput%
[Update Settings:]yourwordinghere: %longserviceoutput%
My example:

Let me know how things look,
Perry
Re: Email of multiline output
We have already done this to all users by setting up the Notification Management setting and deploying this out to users.
https://support.nagios.com/forum/postin ... 1#pr336722
***** Nagios XI Alert *****
%alertsummary%
Notification Type: %type%
Service: %service%
Host: %host%
Address: %hostaddress%
State: %servicestate%
Info:
"%serviceoutput%"
"%longserviceoutput%"
Date/Time: %datetime%
Rapid Respond: %responseurl%
Nagios URL: %xiserverurl%
https://support.nagios.com/forum/postin ... 1#pr336722
***** Nagios XI Alert *****
%alertsummary%
Notification Type: %type%
Service: %service%
Host: %host%
Address: %hostaddress%
State: %servicestate%
Info:
"%serviceoutput%"
"%longserviceoutput%"
Date/Time: %datetime%
Rapid Respond: %responseurl%
Nagios URL: %xiserverurl%
Re: Email of multiline output
Hello @hbouma
Let's add Eventhandler to the 'check_files' service check sent with a built-in Event notifier to verify '$LONGSERVICEOUTPUT$'. I want to verify before digging into the /usr/local/integrate/everbridge/onCallEvent.sh' notifier.
Configure > Core Configuration Manager > Commands
Let us know how things look,
Perry
Let's add Eventhandler to the 'check_files' service check sent with a built-in Event notifier to verify '$LONGSERVICEOUTPUT$'. I want to verify before digging into the /usr/local/integrate/everbridge/onCallEvent.sh' notifier.
Configure > Core Configuration Manager > Commands
- Update the notification commands to include: [list]
- \n$LONGSERVICEOUTPUT$
Let us know how things look,
Perry
Re: Email of multiline output
I am sending you a PM.