Hello @hbouma
Thanks for pinging back on this one; as we recall from previous correspondence on this thread, we know that we are limited
on postfix text formatting available.
Want to find out what specific formatting you are looking to make adjustments to? Please send over an example when you get a chance.
Thanks,
Perry
Email of multiline output
Re: Email of multiline output
We are looking to find a way to email the information found from our check to the contact with new lines inserted between files found as opposed to the \n that is currently being inserted.
I will PM you the plugin that we are running.
I will PM you the plugin that we are running.
Re: Email of multiline output
Hello @hbouma
Spun-up my test vm on this and want to verify with you that you are receiving the results from the 'check_files' script on the web console dashboard and email? Is it the format on the email that is off?
Here are the example results that I receive from my test VM for your review:
Let us know how things look from your end.
Thanks,
Perry
Spun-up my test vm on this and want to verify with you that you are receiving the results from the 'check_files' script on the web console dashboard and email? Is it the format on the email that is off?
Here are the example results that I receive from my test VM for your review:
- Command: [list]
- /usr/local/nagios/libexec/check_ncpa.py -H 192.168.xxx.xxx -t 'welcome' -P 5693 -M 'plugins/check_files.ps1' -q "args=C:\temp 9999"
Files modified in the last 9999 minutes. Files are:
C:\temp\check_files.ps1
C:\temp\check_tcp - Shortcut.lnk
C:\temp\New Text Document (6) - Copy - Copy - Shortcut.lnk
C:\temp\nxlog-ce-latest - Shortcut.lnk
C:\temp\op5.ini
C:\temp\putty - Shortcut.lnk
C:\temp\winrpe_5.4.0_x64_free_installer - Shortcut (2).lnk
C:\temp\winrpe_5.4.0_x64_free_installer - Shortcut.lnk
- Delivered-To: nagios@localhost
Received: by localhost.localdomain (Postfix, from userid 1000)
id 470E8875430; Wed, 24 Nov 2021 10:06:49 -0600 (CST)
To: nagios@localhost
Subject: PROBLEM Service Alert - 192.168.xxx.xxx/Plugin check_files.ps1 is CRITICAL
X-PHP-Originating-Script: 1000:class.phpmailer.php
Date: Wed, 24 Nov 2021 10:06:49 -0600
From: Nagios XI <root@localhost>
Reply-To: Nagios XI <root@localhost>
Message-ID: <5ee57746b11e7878fad175d5b00400d0@localhost>
X-Priority: 1
X-Mailer: PHPMailer 5.2.27 (https://github.com/PHPMailer/PHPMailer)
X-MSMail-Priority: High
Importance: High
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
***** Nagios XI Alert *****
Nagios has detected a problem with this service.
Notification Type: PROBLEM
Service: Plugin check_files.ps1
Host: 192.168.xxx.xxx
Address: 192.168.xxx.xxx
State: CRITICAL
Info:
Files modified in the last 9999 minutes. Files are:
Date/Time: 2021-11-24 10:06:49
Respond: http://192.168.xxx.xxx/nagiosxi/rr.php? ... 8c85dd6220
Nagios URL: http://192.168.xxx.xxx/nagiosxi/
Add: C:\temp\check_files.ps1\nC:\temp\check_tcp - Shortcut.lnk\nC:\temp\New Text Document (6) - Copy - C
opy - Shortcut.lnk\nC:\temp\nxlog-ce-latest - Shortcut.lnk\nC:\temp\op5.ini\nC:\temp\putty - Shortcut.lnk
\nC:\temp\winrpe_5.4.0_x64_free_installer - Shortcut (2).lnk\nC:\temp\winrpe_5.4.0_x64_free_installer - S
hortcut.lnk\n\n\t
Let us know how things look from your end.
Thanks,
Perry
You do not have the required permissions to view the files attached to this post.
Re: Email of multiline output
Correct. We see the information, but when it gets emailed, it has a \n instead of a new line from our Linux RHEL 7.9 servers.
Re: Email of multiline output
Hello @hbouma
Spinning up a test VM to see what mailx will look like sending plain/text via smtp. Will follow up shortly.
Thanks,
Perry
Spinning up a test VM to see what mailx will look like sending plain/text via smtp. Will follow up shortly.
Thanks,
Perry
Re: Email of multiline output
Hello @hbouma
To follow up on the progress, in my test environment we see that the 'phpmailer.php' (xi_service_notification_handler) definitely formats differently than what we see when we send out with mailx using for example 'notify-host-by-email' or 'notify-service-by-email'.
I will continue to work on this and follow up with the results,
Perry
To follow up on the progress, in my test environment we see that the 'phpmailer.php' (xi_service_notification_handler) definitely formats differently than what we see when we send out with mailx using for example 'notify-host-by-email' or 'notify-service-by-email'.
I will continue to work on this and follow up with the results,
Perry
Re: Email of multiline output
Hello @hbouma
I will be working on this throughout the day and will follow up shortly.
Thanks,
Perry
I will be working on this throughout the day and will follow up shortly.
Thanks,
Perry
Re: Email of multiline output
Hello @hbouma
To follow up, made the following updates to my test VM which results in a carriage return/linefeed on the $LONGSERVICEOUTPUT$ on 'check_files.ps'.
Verify config found under Admin > System Settings > General Tab > Allow HTML Rendering:
Perry
To follow up, made the following updates to my test VM which results in a carriage return/linefeed on the $LONGSERVICEOUTPUT$ on 'check_files.ps'.
Verify config found under Admin > System Settings > General Tab > Allow HTML Rendering:
- Allow HTML tags in host/service statuses
- Allow HTML tags in host/service comments
- Receive emails in plain text only
Perry
You do not have the required permissions to view the files attached to this post.
Re: Email of multiline output
I think you found the issue. The "Allow HTML Tags in Host/Service Status" was not checked.
Thank you!!!!
Thank you!!!!