cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

mcafee nsp api - update alert

when i try to save alert

url=" https://myIPS/sdkapi/alerts/$uniqueId"

    $this.WebClient.Headers.Set('NSM-SDK-API',$this.NSMSDKAPI)

           

          $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"

        $headers.Add("NSM-SDK-API", $this.NSMSDKAPI )

        $headers.Add('Content-Type','application/json')

       $headers.Add('Accept','application/vnd.nsm.v1.0+json')

        $JSONMSG = @{

           assignTo='xxxxxxx'

             alertState='Acknowledged'

          #   sensorId=1004

                    }

$json = $JSONMSG | ConvertTo-Json

            $response = Invoke-RestMethod $url -Method Put -Body $json  -Headers $headers

i got the following error

Invoke-RestMethod : {"errorId":9803,"errorMessage":"Sensor ID is required"}

At C:\Temp\epo\epo.ps1:307 char:25

+ ... $response = Invoke-RestMethod $url -Method Put -Body $json  -Headers  ...

+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException

    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

can someone help with this error ?

did someone succeeded to update alert Record and can share how?

7 Replies

Re: mcafee nsp api - update alert

it seems that the api does not like the format of https://myIPS/sdkapi/alerts/<ALERTid>

i tried other commands and when you have id in the url it does not work

i tied alertid and tried alert uuid in both cases same errorr 9803

in the reference 9803 is error for wrong alertid

the error in api is sensor is missing

who can i contact for help?

Re: mcafee nsp api - update alert

You can open a Service Request with McAfee support if you have a support contract

https://support.mcafee.com/

Re: mcafee nsp api - update alert

hi Peter

do you have any experience with it ?

Reliable Contributor mjesmer
Reliable Contributor
Report Inappropriate Content
Message 5 of 8

Re: mcafee nsp api  - update alert

@Peter - Chances are Support won't be much help...most of us have/had very little experience using the API to do anything.

Now if he can get a case open and somehow convince them to escalate to SEO...a number of those resources have used the API.

@Ygross75 - Whatever you do, I hope you get this issue resolved.

I have limited experience using the API, and I have no idea what is going on here. I'll put my head to it, but don't expect anything anytime soon.

Re: mcafee nsp api - update alert

solved the issue by myself thanks for all your help

Re: mcafee nsp api - update alert

Hi ygross75,

How did you resolve the issue?

Thanks

Peter Mason

Re: mcafee nsp api - update alert

@ygross75 I am stuck in a similar situation. Trying to pull the alert details from below link but it is giving me the same error you got. Please help rectify the issue.

GET https://<NSM_IP>/sdkapi/alerts/6245941293374080682


Tags (1)
Member Rewards
McAfee Community rewards active and helpful members just like you. Click here to take a look at the first community members who received a special reward and were recognized by McAfee leader, Aneel Jaeel, for their participation and trusted knowledge in the community.