After reading the questions and answers, I found myself with the same problem of trying to get the information in a readable-ish format, and going through an Office 365 cloud server. The internal_sendmail command wasn't working for me because the Mgmt server's hostname was only FW-MGT (didn't have an FQDN), so Office365 always rejected it. So I'm using the regular sendmail in Gaia.
Note: In the Office365 Exchange Admin, I went to the spam whitelist and added the NAT address of the Mgmt server so that Office365 accepts the emails. It doesn't allow relays because the connection is not authenticated, and getting Auth to work was more trouble than I wanted.
The script reads the standard input and puts it into an $input variable. Then I use sed to replace the semi-colon with newlines, and write it to a file. Then I read the file again with sed, to output only the line that has either 'System Alert' or 'cluster_info' (the two most common events I found, but you can add more if you want), and put it into a $subject variable.
I then erase the file by writing the 'To: ' line, i.e 'To: SOC team'.
Then I append the 'Subject: Check Point: $subject' line to the file, so that it's apparent what's going on from the subject of the email.
Then I append a blank line, and then append the $input processed as before with sed, changing semi-colons to newlines.
Finally I use sendmail with the --domain parameter so that Office365 accepts the EHLO command, -f as the email sender, -v as the email destination address, host as the mail server, and the input is the file we create above. As you can see I use Office365 with the yourdomain-com.mail.protection.outlook.com host.
The entire script looks like this:
#!/bin/bash
read input
echo $input | sed 's/;/\n/g' >mail.txt
subject="$(sed -n -e '/cluster_info/p' -e '/System Alert/p' mail.txt)"
echo "TO: SOC Team" > mail.txt
echo "Subject: Check Point: $subject" >> mail.txt
echo "" >>mail.txt
echo $input | sed 's/;/\n/g' >>mail.txt
sendmail --domain=checkpoint.com -f cpalerts@checkpoint.com -v alerts@yourdomain.com --host=yourdomain-com.mail.protection.outlook.com
Remember to chmod 555 the script so that it can run, and then use it in the User defined alerts of Global Properties.
The email you receive will look something like:
Subject: Check Point: System Alert message: CLUSTER-CP is disconnected
HeaderDateHour: 5Aug2019 21:34:21
ContentVersion: 5
HighLevelLogKey: N/A
Uuid: {0x0,0x0,0x0,0x0}
SequenceNum: 1
Action:
Origin: FW-MGT
IfDir: <
IfName: N/A
Alert: useralert
OriginSicName: N/A
System Alert message: GW1 is disconnected
Object: GW1
Event: Exception
Parameter: status_connection
Condition: is
Current value: 8
ProductName: System Monitor
ProductFamily: Network