VMware Cloud Community
Kube1984
Contributor
Contributor

Alert API

Been developing for HTTP output plugin and its lacking some of the info that is the email out put.

Is there any way to edit the HTTP output JSON\XML to include like trigger info or anomalies.

Secondly if I can't edit the output, can I all back into vRops with the API to get that info?

I was able to get to the contributing symptoms, but short of a list of IDs I cant get any info about those.

Thanks

18 Replies
KabirAli82
Expert
Expert

There are 2 ways to do this;

1)

https://vman.ch/vrops-custom-rest-outbound-plugin/

2)

https://nodered.org/

I would go for option 2. With Node-RED you can do al sorts of things with the output of any API inbound/outbound call.


Was I helpful? Give a kudo for appreciation!
Braindumping @ http://kablog.nl/
Tweeting @ https://twitter.com/_Kabir_Ali_
Reply
0 Kudos
alaingeenrits1
Enthusiast
Enthusiast

Have you been succesful with Node Red ? In vROps 8.1 I cannot get the outbound plugin to test. Same with ifttt.

ddetails:

I am trying the rest API outbound settings in vROps 8.1 to send alerts to my own service. I always get a “could not post error” if I test. To make sure no ssl hell I tried IFTTT too, same thing. I found that the url has to be https, I got fingerprint from the certificates in the browser. Tried no username and password and „none“. Are these Fields mandatory ? Any experience? Where do I look in the log files for this ?

Reply
0 Kudos
KabirAli82
Expert
Expert

I've build flows in Node-RED so vROPs can API chat with the customers own ticketing system.

Setup this simple flow in Node-RED:

vROPs-Node-RED1.JPG

Properties of msg vROPs Alert

vROPs-Node-RED2.JPG

Properties of vROPs Alert

vROPs-Node-RED3.JPG

Properties of vROPs Alert 201

vROPs-Node-RED4.JPG

Be sure to configure the outbound REST API like this (mind the /alert the end of URL)

vROPsRESTAPI.JPG

If you still don't see anything in the debug windows of Node-RED you should check if a firewall is not blocking your traffic. G'luck!


Was I helpful? Give a kudo for appreciation!
Braindumping @ http://kablog.nl/
Tweeting @ https://twitter.com/_Kabir_Ali_
Reply
0 Kudos
alaingeenrits1
Enthusiast
Enthusiast

Thanks for this, allowed me to check some things. I had an error in the http response. I tested things out with Postman.

It does not work yet for vROps outbound settings, but I guess the problem is my Nodered server uses a self-signed ssl certificate. Do you use a server with 'real' cert ? Did you not fill out the cert thumbprint ? I assume you use a https url ?

Reply
0 Kudos
KabirAli82
Expert
Expert

A default Node-RED install is without certs. Make it yourself easy and try HTTP (so without certs.)

If you must use HTTPS make sure you get the correct cert thumbprint;


Was I helpful? Give a kudo for appreciation!
Braindumping @ http://kablog.nl/
Tweeting @ https://twitter.com/_Kabir_Ali_
Reply
0 Kudos
alaingeenrits1
Enthusiast
Enthusiast

In vROps 8.0 unfortunately you have to use https... Setup Node-Red with self-signed cert. Which is probably the problem. No luck with the thumbprints...

Reply
0 Kudos
jddias
VMware Employee
VMware Employee

A few months back I was helping a customer with the plugin and noted that the REST request was not sending auth headers. Eng confirmed the bug and released a fix in 8.1.1 - have you upgraded?

vRealize Operations Manager 8.1.1 Release Notes

Visit my blog for vCloud Management tips and tricks - http://www.storagegumbo.com
alaingeenrits1
Enthusiast
Enthusiast

I am still on 8.1 in the lab :smileyblush: Downloading upgrade now. Does that mean you always have to send basic auth? Does it handle self-signed cert or do I need to get a let's encrypt cert for my machine ?

See you on the bitstream ! Alain

Reply
0 Kudos
jddias
VMware Employee
VMware Employee

Yeah, only basic auth is supported. Self-signed certs should be fine, as long as the thumbprint matches.

Visit my blog for vCloud Management tips and tricks - http://www.storagegumbo.com
Reply
0 Kudos
alaingeenrits1
Enthusiast
Enthusiast

No luck yet with 8.1.1 What are the required fields ? Do you have to specify user and passed ? Even IFTTT does not work. Starting Wireshark to trace...

Reply
0 Kudos
jddias
VMware Employee
VMware Employee

Does IFTTT require a user/pass? You only need to include that if you have to log in.

Visit my blog for vCloud Management tips and tricks - http://www.storagegumbo.com
Reply
0 Kudos
alaingeenrits1
Enthusiast
Enthusiast

No it does not. Weird. The Post seems not even sent to the endpoint... Always error posting...

Reply
0 Kudos
jddias
VMware Employee
VMware Employee

What's the error?

Visit my blog for vCloud Management tips and tricks - http://www.storagegumbo.com
Reply
0 Kudos
KabirAli82
Expert
Expert

Make sure to reply with a 200, else you will hit that error all the time.

Any luck with Node-RED without SSL?


Was I helpful? Give a kudo for appreciation!
Braindumping @ http://kablog.nl/
Tweeting @ https://twitter.com/_Kabir_Ali_
Reply
0 Kudos
alaingeenrits1
Enthusiast
Enthusiast

pastedImage_0.png

Reply
0 Kudos
alaingeenrits1
Enthusiast
Enthusiast

The test now works with 8.1.1 and Node-Red without SSL ! Yippie! OK I will concentrate on that, I think IFTTT does not like the alert variable at the end. The doc stil states you need SSL though...

Thanks for your help John!

Reply
0 Kudos
jddias
VMware Employee
VMware Employee

Yeah, that error will almost always appear, unless the endpoint responds with 2xx on both POST and PUT. The adapter attempts both methods and if one fails you get the error. It's best to just confirm at the endpoint.

Visit my blog for vCloud Management tips and tricks - http://www.storagegumbo.com
Reply
0 Kudos
alaingeenrits1
Enthusiast
Enthusiast

And thanks Ali of course !