cancel
Showing results for 
Search instead for 
Did you mean: 
Create a Post
Highlighted

Syslog alert for power supply failure

Jump to solution

I have been trying to find the file or parameter responsible for monitoring of power supply status on Check Point firewalls.

In F5 products, it can be modifies using /etc/alertd/alert.conf file, However, I cannot find any option for Check Point.

Purpose is generate syslog message and not to use cp_monitor or snmp monitoring for power supply failure.

0 Kudos
1 Solution

Accepted Solutions
JozkoMrkvicka
Platinum

Re: Syslog alert for power supply failure

Jump to solution

More elegant one-Liner:

if cpstat os -f power_supply | grep -qi "down"; then logger -s -p kern.crit -t kernel 'PSU is down !!! Please replace faulty PSU.'; fi

This command will check if output of "cpstat os -f power_supply" contains string "down" (not case sensitive) and in case yes, issue command logger with facility kern and priority crit to print desired text in /var/log/messages in order to be caught by any Syslog server as critical message (or check it some other way within logs).

Just schedule this one line using cron job every day and you have monitoring of PSU in place 🙂

Please note that there are some exceptions where PSU is considered as down, but not really:

sk107199 - Power Supply sensors are shown as "Up" or "Down" when using one Power Supply and one Powe...

 

Another solution is to use snmpwalk to get status of PSUs, or create trap for it:

image.png

 

OID Name: powerSupplyStatus

OID Number: 1.3.6.1.4.1.2620.1.6.7.9.1.1.2

Kind regards,
Jozko Mrkvicka
0 Kudos
4 Replies

Re: Syslog alert for power supply failure

Jump to solution

Afaik such a feature is based on hardware sensor information, e.g. see sk111273 for using SNMP where Smart-1 25, 50 and 150 hardware does not support sensors for power supply and RAID failure. So please specify where you need that!

0 Kudos
Danny
Pearl

Re: Syslog alert for power supply failure

Jump to solution

You could use GAiA's job scheduler to monitor it via a simple One-Liner like this:

clish -c 'show sysenv all' | grep Power | awk '{print $3": "$4}' | sed 's/#//' | tr '\n' ' ' | sed 's/Up /Up  /'

and have it sending a message to syslog if the status is not Up.

Re: Syslog alert for power supply failure

Jump to solution

Nice One-Liner.

0 Kudos
JozkoMrkvicka
Platinum

Re: Syslog alert for power supply failure

Jump to solution

More elegant one-Liner:

if cpstat os -f power_supply | grep -qi "down"; then logger -s -p kern.crit -t kernel 'PSU is down !!! Please replace faulty PSU.'; fi

This command will check if output of "cpstat os -f power_supply" contains string "down" (not case sensitive) and in case yes, issue command logger with facility kern and priority crit to print desired text in /var/log/messages in order to be caught by any Syslog server as critical message (or check it some other way within logs).

Just schedule this one line using cron job every day and you have monitoring of PSU in place 🙂

Please note that there are some exceptions where PSU is considered as down, but not really:

sk107199 - Power Supply sensors are shown as "Up" or "Down" when using one Power Supply and one Powe...

 

Another solution is to use snmpwalk to get status of PSUs, or create trap for it:

image.png

 

OID Name: powerSupplyStatus

OID Number: 1.3.6.1.4.1.2620.1.6.7.9.1.1.2

Kind regards,
Jozko Mrkvicka
0 Kudos