3 Replies Latest reply on Oct 1, 2020 7:33 AM by snakhuda123

    KB article to create custom alerting is not working for me

    snakhuda123 Lurker

      Hi team,

       

      Hoping to see if you can pin point the root cause of this 400 error pasted below. I am trying to create a new email template and I get 400 error.

       

      VMware Knowledge Base

       

      Executed step 3 from KB article by replacing IP address of the master node.

       

      ]# curl -k -X POST -i -H "X-vRealizeOps-API-use-unsupported: true" -H "Content-Type: application/json; charset=UTF-8" -u admin -d '{
      "id" : null,
      "name" : "Email Template 1",
      "html" : true,
      "template" : "$$Subject=[Email Template 1 Subject] State:{{AlertCriticality}}, Name:{{AffectedResourceName}} \n\n New alert was generated at: {{AlertGenerateTime}} Info: {{AffectedResourceName}} {{AffectedResourceKind}}
      Alert Definition Name: {{AlertDefinitionName}}
      Alert Definition Description: {{AlertDefinitionDesc}}
      Object Name : {{AffectedResourceName}}
      Object Type : {{AffectedResourceKind}}
      Alert Impact: {{AlertImpact}}
      Alert State : {{AlertCriticality}}
      Alert Type : {{AlertType}}
      Alert Sub-Type : {{AlertSubType}}
      Object Health State: {{ResourceHealthState}}
      Object Risk State: {{ResourceRiskState}}
      Object Efficiency State: {{ResourceEfficiencyState}}
      Symptoms:
      {{Anomalies}} Recommendations: {{AlertRecommendation}} vROps Server - {{vcopsServerName}} Alert details
      ",
      "others" : [ ],
      "otherAttributes" : {}
      }' https://10.50.6.88/suite-api/api/notifications/email/templates
      Enter host password for user 'admin':
      HTTP/1.1 400 400
      Date: Wed, 30 Sep 2020 19:01:08 GMT
      Server: Apache
      X-Request-ID: 4hh8Gupwd06DRmHiPoyKGdqIXSDJic1s
      Access-Control-Allow-Origin: *
      Cache-Control: no-cache, no-store, max-age=0, must-revalidate
      Pragma: no-cache
      Expires: 0
      Strict-Transport-Security: max-age=31536000; includeSubDomains
      X-XSS-Protection: 1; mode=block
      X-Frame-Options: SAMEORIGIN
      X-Content-Type-Options: nosniff
      Content-Security-Policy: default-src https: data: 'unsafe-inline' 'unsafe-eval'; child-src *
      Vary: User-Agent
      Connection: close
      Transfer-Encoding: chunked
      Content-Type: application/xml

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?><ops:error xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ops="http://webservice.vmware.com/vRealizeOpsMgr/1.0/" httpStatusCode="400" apiErrorCode="400"><ops:message>Invalid input format.</ops:message><ops:moreInformation><ops:info name="api-uri">/suite-api/api/notifications/email/templates</ops:info></ops:moreInformation></ops:error>

       

       

      thanks,

      Salman