Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Vivek_Singh1
Explorer
Jump to solution

Syslog alert for power supply failure

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
Authority
Authority

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

View solution in original post

0 Kudos
6 Replies
G_W_Albrecht
Legend Legend
Legend

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!

CCSP - CCSE / CCTE / CTPS / CCME / CCSM Elite / SMB Specialist
0 Kudos
Danny
Champion Champion
Champion

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.

HeikoAnkenbrand
Champion Champion
Champion

Nice One-Liner.

➜ CCSM Elite, CCME, CCTE ➜ www.checkpoint.tips
0 Kudos
JozkoMrkvicka
Authority
Authority

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
Danny
Champion Champion
Champion

Relying on ipmitool would be more reliable to make sure to get power_supply data even from open servers. Instead of snmpwalk better use stattest which also works with more secure SNMP versions, such as SNMPv3.

JozkoMrkvicka
Authority
Authority

Interesting "stattest" command which I was not aware about. But since it still uses SNMP OIDs, which is mandatory to be configured, not sure if there can be different result from snmpwalk vs. stattest.

Kind regards,
Jozko Mrkvicka
0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events