My script that updates the sensor's comments under a group is no longer working. This worked before. Could this be due to PRTG upgrades lately?

This is the script:

#!/bin/bash
groupID=116442
uname=****.*****
hash=********** 
runbookURL=https://asurion.service-now.com/kb_view.do?sysparm_article=KB0015183
prtgURL=`echo $runbookURL | sed -e 's/+/%2b/g'`
output="This is a Front Office L2 Support EU Squad sensor.%0D%0ARunbook: $prtgURL";
curl -k "https://prtg.prod.asurion.net/api/table.xml?content=sensors&output=xml&columns=objid,device,sensor,status&id=$groupID&username=$uname&passhash=$hash" | while read item; do
    id=$(echo $item | grep '<objid' | cut -f2 -d">" | cut -f1 -d"<";)
    if [ -n "$id" ]
    then
        curl -k "https://prtg.prod.asurion.net/api/setobjectproperty.htm?id=$id&name=comments&value=$output&username=$uname&passhash=$hash" | awk -F"[><]" '{print $7}'
    fi
done

Article Comments

Do you get an error when calling it? What's PRTGs response to your query?


Dec, 2016 - Permalink

No error in PRTG but the comments tab is not uodated. Executed the script in mobaxterm.


Dec, 2016 - Permalink

Do you have an example comment you're trying to set so I can test this? Maybe it's character within the comment that causes the URL to be faulty or something like that.


Dec, 2016 - Permalink