Skip to content

Instantly share code, notes, and snippets.

@dalehamel
Created June 17, 2016 04:56
Show Gist options
  • Select an option

  • Save dalehamel/a57f7f7b189c2d3a50ff34ffcd4f9a2e to your computer and use it in GitHub Desktop.

Select an option

Save dalehamel/a57f7f7b189c2d3a50ff34ffcd4f9a2e to your computer and use it in GitHub Desktop.
Enable snmp traps on supermicro ipmi
# 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"
@pasha-admin

Copy link
Copy Markdown

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