I'm trying to add new amazon cloudwatch sensors using the prtg api from the command line. For example when a new EC2 instance is generated in Amazon, I want to add the new instance to PRTG. I have the access keys and can sample the Amazon API for the instance ID, but I'm not sure how to add it into PRTG automatically. Any ideas?


Article Comments

Hello,

you can do this with the PRTG API, see "Setup"->"PRTG API"->"Object Manipulation":

  1. Duplicate the existing sensor:
/api/duplicateobject.htm?id=id_of_sensor_to_clone&name=new_name&targetid=id_of_target_device
  1. Then use the setobjectproperty API-Call to change the Accesskey & Instance ID:
/api/setobjectproperty.htm?id=10214&name=PROPERTY&value= 

The properties for the Amazon Cloudwatch sensor are:

  • Accesskeyid
  • Secretaccesskeyid
  • Location
  • Service (static, cannot be changed on existing/cloned sensors)
  • instance

So it is important to only clone sensors for the same types of Amazon instances best regards.


Sep, 2012 - Permalink