Created
June 17, 2016 04:56
-
-
Save dalehamel/a57f7f7b189c2d3a50ff34ffcd4f9a2e to your computer and use it in GitHub Desktop.
Enable snmp traps on supermicro ipmi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable SNMP | |
USER= | |
PASS= | |
IPMI_HOST= | |
TARGET=127.0.0.1 | |
INDEX=1 # one indexed alert to set | |
SESSION_ID=$(curl -d "name=${USER}&pwd=${PASS}" "https://${IPMI_HOST}/cgi/login.cgi" --silent --insecure -i | awk '/Set-Cookie/ && NR != 2 { print $2 }') | |
# Severity -> | |
# 0 -> 00 is disabled | |
# 1 -> 2 is informational | |
# 2 -> 8 is warn | |
# 3 -> 16 is critical | |
# 4 -> 32 is non-recoverable | |
curl -X POST -H "Cookie: ${SESSION_ID}" --insecure "https://${IPMI_HOST}/cgi/op.cgi" -d "&op=config_alert&ip=${TARGET}&severity=2&index=${index}&fun=m&time_stamp=12345" |
Could you share documentation where I can find different attributes for request?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Thanks for this one - I could really use it :-) One little typo though: In the declaration block index is written in capitals, in the curl call it is not. Fine if you only want to set one SNMP trap host. ;-)
Best,
Jan