- Community Home
- >
- Software
- >
- HPE OneView
- >
- get appliance alert
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp
Knowledge Base
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 04:39 AM - last edited on 04-11-2023 06:38 AM by support_s
04-11-2023 04:39 AM - last edited on 04-11-2023 06:38 AM by support_s
We have an alert that says, "One or more appliance resources are below the minimum required values." This happened from an accident one of the HPE techs did. It has been repaired, but the alert will not go away. I know how to remove it once I get the alrt URI and etag, but I can't seem to find it in the alerts. I don't think I am filter correctly to retrieve it? I tried healthCategory EQ Appliance, but that did not find it. This is how I pull down Active allerts:
# We have multiple sites. So, I set a site variable so that I can run the same commands
# simultaneously in multiple terminals.
SITE='<site name>'
ALERTN=alert-${SITE}
ACTV=$(python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))" "\"alertState EQ 'Active'\"")
curl --insecure \
--header "X-API-Version: ${currentVersion}" \
--header "auth: ${sessionID}" \
--output ${ALERTN} \
--request GET ${OneView}/rest/alerts?start=0&count=-1&filter=${ACTV}
#
# That only pulls down 25 alerts. Pull down the rest with:
i=1
NEXT=$(jq -r '.nextPageUri' ${ALERTN} | sed -e "s|\(.*filter=\).*|\1${ACTV}|")
while [[ ${NEXT} != *"null"* ]]; do
curl --insecure \
--header "X-API-Version: ${currentVersion}" \
--header "auth: ${sessionID}" \
--output ${ALERTN}${i} \
--request GET ${OneView}${NEXT}
NEXT=$(jq -r '.nextPageUri' ${ALERTN}${i} | sed -e "s|\(.*filter=\).*|\1${ACTV}|")
((i++))
done
# Concantenate into a single file.
j=0
while [[ ${j} -t ${i} ]]; do
echo ${j}
if [[ ${j} -eq 0 ]]; then
CMD="cat ${ALERTN}"
else
CMD="${CMD} ${ALERTN}${j}"
fi
((j++))
done
$(echo ${CMD} > alert-all-raw-${SITE})
cat alert-all-raw-${SITE} | jq -r '.' > alert-${SITE}-all
ALERTS=alert-${SITE}-all
/bin/rm alert-${SITE} alert-${SITE}? alert-${SITE}[1-9]? alert-all-raw-${SITE}I tried changing the filter to
healthCategory EQ 'Appliance'
but that did not work. The alertTypeID is DYNAMIC.CONFIG. The alert says:
One or more appliance resources are below the minimum required values.
Does anyone know how to get the alert URI and eTag values either through the REST API or the GUI?
Solved! Go to Solution.
- Tags:
- OneView
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 06:36 AM
04-11-2023 06:36 AM
SolutionI figured it out:
SITE='<site name>'
ALERTN=alert-${SITE}
ACTV=$(python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))" "\"alertState EQ 'Locked'\"")
curl --insecure \
--header "X-API-Version: ${currentVersion}" \
--header "auth: ${sessionID}" \
--output ${ALERTN} \
--request GET ${OneView}/rest/alerts?start=0&count=-1&filter=${ACTV}
#
# That only pulls down 25 alerts at most, but it should be enough.
DESCRIP="One or more appliance resources are below the minimum required values."
#
# Can see the data we are after with:
jq -r '.members[] | select(.description=="'"${DESCRIP}"'") | { "uri": .uri, "eTag": .eTag, "description": .description }' ${ALERTN}
ALRTURI=$(jq -r '.members[] | select(.description=="'"${DESCRIP}"'") | .uri' ${ALERTN})
ETAG=jq -r '.members[] | select(.description=="'"${DESCRIP}"'") | .eTag' ${ALERTN})
USER='<your sid>'
NOTE="The resources have been fixed"
DATA='{ "alertState": "Cleared", "assignedToUser": "'${USER}'", "alertUrgency": "None", "notes": "'${NOTE}'", "eTag": "'${ETAG}'" }'
echo ${DATA} | jq -r '.'
curl --insecure --silent \
--header "content-type: application/json" \
--header "X-API-Version: ${currentVersion}" \
--header "auth: ${sessionID}" \
--data "${DATA}" \
--request DELETE ${OneView}${ALRTURI}?force=true
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 08:48 PM
04-11-2023 08:48 PM
Re: get appliance alert
Hello @bradawk1,
That's awesome!
We are glad to know you were able to find the solution and thank you for keeping us updated.