<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: closing an alert in HPE OneView</title>
    <link>https://community.hpe.com/t5/hpe-oneview/closing-an-alert/m-p/7058016#M4455</link>
    <description>&lt;P&gt;Hi Bashkar,&lt;/P&gt;&lt;P&gt;The extra double quote in the if-match line was a typo.&amp;nbsp; On my system I had&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;--header "If-Match: '*'"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All of the other headers have a "Name" followed by a colon and then a "Value."&amp;nbsp; I expected the same for this header.&amp;nbsp; But once I removed the colon, it worked!&amp;nbsp; It worked either if I got the correct eTag, or left the eTag empty.&amp;nbsp; WIth getting the eTag, I used:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ALERTURI='/rest/alerts/2177698'
ETAG=$(curl --insecure \
            --header "X-API-Version: ${currentVersion}" \
            --header "auth: ${sessionID}" \
            --request GET "${OneView}${ALERTURI}" | jq -r '.eTag')
USER=Brad
NOTE='Server no longer under maintenance'
DATA='{ "alertState": "Cleared", "assignedToUser": "'${USER}'", "alertUrgency": "None", "notes": "'${NOTE}'", "eTag": "'${ETAG}'" }'
echo ${DATA} | jq -r '.'
curl --insecure \
     --header "content-type: application/json" \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --header "If-Match '*'" \
     --data "${DATA}" \
     --request PUT "${OneView}${ALERTURI}" | jq -r '.'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can also just set ETAG='' and it works.&amp;nbsp; &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for the help!&amp;nbsp; &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Aug 2019 10:12:52 GMT</pubDate>
    <dc:creator>BradV</dc:creator>
    <dc:date>2019-08-08T10:12:52Z</dc:date>
    <item>
      <title>closing an alert</title>
      <link>https://community.hpe.com/t5/hpe-oneview/closing-an-alert/m-p/7057747#M4442</link>
      <description>&lt;P&gt;I can retrieve active alerts with:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ACTIVE=$(curl --insecure \
              --header "X-API-Version: ${currentVersion}" \
              --header "auth: ${sessionID}" \
              --request GET ${OneView}/rest/alerts?start=0&amp;amp;count=-1&amp;amp;filter="alertState EQ 'Active'")&lt;/LI-CODE&gt;&lt;P&gt;Some of the alerts are on older servers that are no longer under maintenance.&amp;nbsp; I'm trying to clear the alert with:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;USER=Brad
NOTE='Server no longer under maintenance'
DATA='{ "alertState": "Cleared", "assignedToUser": "'${USER}'", "alertUrgency": "None", "notes": "'${NOTE}'", "eTag": "" }'
ALERTURI='/rest/alerts/2177698'
curl --insecure \
     --header "content-type: application/json" \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --header "If-Match" '*'" \
     --data "${DATA}" \
     --request PUT "${OneView}${ALERTURI}" | jq -r '.'&lt;/LI-CODE&gt;&lt;P&gt;but am getting back "parse error: Invalid numeric literal at line 1, column 10."&amp;nbsp; I can echo ${DATA} | jq -r '.' and get back a valid JSON object.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 11:23:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/closing-an-alert/m-p/7057747#M4442</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-08-06T11:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: closing an alert</title>
      <link>https://community.hpe.com/t5/hpe-oneview/closing-an-alert/m-p/7057826#M4445</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;You can clear “active” alerts through PowerShell.&lt;/P&gt;&lt;P&gt;Please find the steps to clear OneView “active” alerts through PowerShell.&lt;/P&gt;&lt;P&gt;1. Download and install HPE.OneView.XX.PowerShell.Library.exe from below link. (where XX is OneView Version)&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/HewlettPackard/POSH-HPOneView/releases" target="_blank" rel="noopener"&gt;https://github.com/HewlettPackard/POSH-HPOneView/releases&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2. Open PowerShell prompt and Check first what the execution policy is in this environment. If it is Restricted, set it to Unrestricted. Type:&lt;/P&gt;&lt;P&gt;Get-ExecutionPolicy&lt;/P&gt;&lt;P&gt;and press Enter. If it is Unrestricted, skip to the next step. If it is Restricted, type:&lt;/P&gt;&lt;P&gt;Set-ExecutionPolicy Unrestricted&lt;/P&gt;&lt;P&gt;Confirm with Y &amp;lt;Enter&amp;gt; and verify if it is Unrestricted now by typing again:&lt;/P&gt;&lt;P&gt;Get-ExecutionPolicy&lt;/P&gt;&lt;P&gt;3. Establish a connection with the appliance by executing below command:&lt;/P&gt;&lt;P&gt;Connect-HPOVMgmt -appliance &amp;lt;IP Address&amp;gt;&lt;/P&gt;&lt;P&gt;where &amp;lt;IP Address&amp;gt; is the IP address of your appliance on the network, and option -appliance is default for the first parameter (might be omitted).&lt;/P&gt;&lt;P&gt;You are asked to enter User (Administrator), Password (password), and optionally Authentication Domain (not used here). After a few seconds, a session is established and prompt changed to show the user and managed server.&lt;/P&gt;&lt;P&gt;4. Run below command view/verify the “active” alerts.&lt;/P&gt;&lt;P&gt;Get-HPOVAlert -State active&lt;/P&gt;&lt;P&gt;5. Verify the active alerts and later run below command to clear “active” alerts.&lt;/P&gt;&lt;P&gt;Get-HPOVAlert -State active | Remove-HPOVAlert -force&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 11:45:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/closing-an-alert/m-p/7057826#M4445</guid>
      <dc:creator>AmRa</dc:creator>
      <dc:date>2021-06-29T11:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: closing an alert</title>
      <link>https://community.hpe.com/t5/hpe-oneview/closing-an-alert/m-p/7057872#M4448</link>
      <description>&lt;P&gt;I don't have any Windows systems.&amp;nbsp; So, no powershell.&amp;nbsp; I know you guys are big on powershell, be we have no Windows servers, workstations, desktops, etc in this enclave, just RHEL.&amp;nbsp; I'll take a look at the powershell scripts and see if they give me an idea.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 12:14:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/closing-an-alert/m-p/7057872#M4448</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-08-07T12:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: closing an alert</title>
      <link>https://community.hpe.com/t5/hpe-oneview/closing-an-alert/m-p/7057992#M4454</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hpe.com/t5/user/viewprofilepage/user-id/1179670"&gt;@BradV&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Was able to get your script to work just with curl the way you have been using.&lt;BR /&gt;The problem here is similar to the other one you have with default-login-domain.&lt;/P&gt;&lt;P&gt;It seems to have to do with single quotes, double quotes, JSON and "curl" sensitivity.&lt;/P&gt;&lt;P&gt;The two fields that seem to give trouble are the single quotes around 'Server no longer under maintenance'&lt;/P&gt;&lt;PRE&gt;NOTE='Server no longer under maintenance'&lt;/PRE&gt;&lt;P&gt;as well as&amp;nbsp;&lt;/P&gt;&lt;P&gt;the extra "double quotes" in the --header below&lt;/P&gt;&lt;PRE&gt;--header "If-Match" '*'"&lt;/PRE&gt;&lt;P&gt;For it to work, this should be --header "If-Match '*'"&lt;BR /&gt;Remove the double quotes soon after If-Match.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what my command line looks like and works.&lt;/P&gt;&lt;P&gt;curl --insecure --header "content-type: application/json" --header "X-API-Version: 800" --header "auth:XYZ" --data '{ "alertState": "Active", "assignedToUser": "administrator", "alertUrgency": "None", "notes": "Server no longer under maintenance", "eTag": "" }' --header "If-Match '*'" --request PUT "&lt;A href="https://myappliance.hpe.com/rest/alerts/5" target="_blank" rel="noopener"&gt;https://myappliance.hpe.com/rest/alerts/5&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;First get a command line like the above with all values substituted working.&lt;BR /&gt;Get all the singlq quote, double quote, URL encoding issues sorted. out.|&lt;BR /&gt;Then convert it to a script like the one you are trying to get working.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Bhaskar&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 07:54:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/closing-an-alert/m-p/7057992#M4454</guid>
      <dc:creator>BhaskarV</dc:creator>
      <dc:date>2019-08-08T07:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: closing an alert</title>
      <link>https://community.hpe.com/t5/hpe-oneview/closing-an-alert/m-p/7058016#M4455</link>
      <description>&lt;P&gt;Hi Bashkar,&lt;/P&gt;&lt;P&gt;The extra double quote in the if-match line was a typo.&amp;nbsp; On my system I had&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;--header "If-Match: '*'"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All of the other headers have a "Name" followed by a colon and then a "Value."&amp;nbsp; I expected the same for this header.&amp;nbsp; But once I removed the colon, it worked!&amp;nbsp; It worked either if I got the correct eTag, or left the eTag empty.&amp;nbsp; WIth getting the eTag, I used:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ALERTURI='/rest/alerts/2177698'
ETAG=$(curl --insecure \
            --header "X-API-Version: ${currentVersion}" \
            --header "auth: ${sessionID}" \
            --request GET "${OneView}${ALERTURI}" | jq -r '.eTag')
USER=Brad
NOTE='Server no longer under maintenance'
DATA='{ "alertState": "Cleared", "assignedToUser": "'${USER}'", "alertUrgency": "None", "notes": "'${NOTE}'", "eTag": "'${ETAG}'" }'
echo ${DATA} | jq -r '.'
curl --insecure \
     --header "content-type: application/json" \
     --header "X-API-Version: ${currentVersion}" \
     --header "auth: ${sessionID}" \
     --header "If-Match '*'" \
     --data "${DATA}" \
     --request PUT "${OneView}${ALERTURI}" | jq -r '.'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can also just set ETAG='' and it works.&amp;nbsp; &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for the help!&amp;nbsp; &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 10:12:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/closing-an-alert/m-p/7058016#M4455</guid>
      <dc:creator>BradV</dc:creator>
      <dc:date>2019-08-08T10:12:52Z</dc:date>
    </item>
  </channel>
</rss>

