...
 
Commits (2)
#!/usr/bin/env bash
#
# Author: Martin Heinrich
#
#
#
# clear event log of idrac
# it uses the PowerEdge Healt CRIT Error in check_mk
#
scriptPath=${0%/*}
. "$scriptPath"/../../libs/bashhelper.sh
. "$scriptPath"/../../libs/shflags
usage() {
echo "
Usage:
$(basename "$0")
Description:
clear event log of idrac
it uses the PowerEdge Healt CRIT Error in check_mk
Examples:
$(basename "$0")
"
exit 1
}
FLAGS_HELP=$(usage)
export FLAGS_HELP
FLAGS "$@" || exit 1 # Parse command line arguments.
eval set -- "${FLAGS_ARGV}"
main() {
logInfo "get idrac log"
filename="/tmp/powerEdge-hostslist.csv"
curl -o ${filename} "https://webis111.medien.uni-weimar.de/monitoring/check_mk/view.py?view_name=powerEdge_Health&_username=web_auto&_secret=XHFESMBBPVUAAPAJTVHU&display_options=Tbfcdexilwoz&output_format=csv"
# delete first line in CSV File
# delete " characters
tail -n +2 "${filename}" | sed 's/"//g' > "${filename}.tmp" && mv "${filename}.tmp" "${filename}"
# --par maximum number of parallel threads
$(dirname $0)/pssh/bin/pssh --inline --askpass --user=webis --hosts="${filename}" \
--outdir=EventlogOut --errdir=err \
--par=10 \
--option="StrictHostKeyChecking=no" "racadm clrsel"
rm "${filename}"
}
#
# Start program with parameters
#
main "$@"
#!/usr/bin/env bash
#
# Author: Martin Heinrich
#
#
#
# printout event log of idrac
# it uses the PowerEdge Healt CRIT Error in check_mk
#
scriptPath=${0%/*}
. "$scriptPath"/../../libs/bashhelper.sh
. "$scriptPath"/../../libs/shflags
usage() {
echo "
Usage:
$(basename "$0")
Description:
printout event log of idrac
it uses the PowerEdge Healt CRIT Error in check_mk
Examples:
$(basename "$0")
"
exit 1
}
FLAGS_HELP=$(usage)
export FLAGS_HELP
FLAGS "$@" || exit 1 # Parse command line arguments.
eval set -- "${FLAGS_ARGV}"
# check requirement
command -v curl >/dev/null 2>&1 || { echo "curl is required, but not installed. please run apt install curl" >&2; exit 1; }
main() {
logInfo "get idrac log"
filename="/tmp/powerEdge-hostslist.csv"
curl -o ${filename} "https://webis111.medien.uni-weimar.de/monitoring/check_mk/view.py?view_name=powerEdge_Health&_username=web_auto&_secret=XHFESMBBPVUAAPAJTVHU&display_options=Tbfcdexilwoz&output_format=csv"
# delete first line in CSV File
# delete " characters
tail -n +2 "${filename}" | sed 's/"//g' > "${filename}.tmp" && mv "${filename}.tmp" "${filename}"
# --par maximum number of parallel threads
$(dirname $0)/pssh/bin/pssh --inline --askpass --user=webis --hosts="${filename}" \
--outdir=EventlogOut --errdir=err \
--par=10 \
--option="StrictHostKeyChecking=no" "racadm getsel"
rm "${filename}"
}
#
# Start program with parameters
#
main "$@"