I try this:

lynx -source "http://myprtgserver/api/getobjectstatus.htm?id=2779&name=totalsens&show=text&username=myuser&password=mypassword" 

and the result is:

<?xml version="1.0" encoding="UTF-8" ?>
<prtg>
<version>8.1.1.1695</version>
<result>13</result>
</prtg>

but if I use upsens instead of totalsens the answer is:

<?xml version="1.0" encoding="UTF-8" ?>
<prtg>
<version>8.1.1.1695</version>
<result><a  title="SQL Nodo A: 12x Up"  href="sensors.htm?id=2779&filter_status=2&filter_status=3"><div class="sensg">12</div></a></result>
</prtg>

and I cannot parse the output of the "result" tag, because it's HTML and not an integer value.


Article Comments

Hello,

the problem is most likely the 'show=text' in the URL. For one reason, that doesn't exist, and also it over-writes the 'show=textraw' from the template (which is actually what you want to get). So please try the URL without 'show=text' and then it should work.

Best Regards.


Nov, 2010 - Permalink

The solution provided by Torsten Lindner works.

Thank you.


Nov, 2010 - Permalink