Created
June 11, 2016 02:19
-
-
Save dalehamel/a5fa04c918b67f36aa75bb7a913416bd to your computer and use it in GitHub Desktop.
Supermicro iKVM preview scraper
This file contains hidden or 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
USER= | |
PASS= | |
IPMI_HOST= | |
SESSION_ID=$(curl -d "name=${USER}&pwd=${PASS}" "https://${IPMI_HOST}/cgi/login.cgi" --silent --insecure -i | awk '/Set-Cookie/ && NR != 2 { print $2 }') | |
ipmi_scrape() | |
{ | |
curl -H "Cookie: ${SESSION_ID}" --insecure "https://${IPMI_HOST}/$1" | |
} | |
time=$(ruby -e 'require "time"; require "uri"; puts URI.escape Time.now.httpdate.gsub(",", "")') | |
ipmi_scrape "/cgi/CapturePreview.cgi?IKVM_PREVIEW_XML=(0,0)&time_stamp=$time" | |
ipmi_scrape "/cgi/url_redirect.cgi?url_name=Snapshot&url_type=img&time_stamp=$time" > scrape.bmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
based on https://gist.github.com/DavidWittman/98281cdf1d32ac795b74