What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

PRTG Sensor Comments batch edit

Votes:

0

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

comments script sensor

Created on Dec 8, 2016 2:22:10 AM

Last change on Dec 8, 2016 7:52:38 AM by  Stephan Linke [Paessler Support]



3 Replies

Votes:

0

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

Created on Dec 8, 2016 7:53:24 AM by  Stephan Linke [Paessler Support]



Votes:

0

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

Created on Dec 8, 2016 9:05:23 AM



Votes:

0

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.

Created on Dec 8, 2016 9:52:32 AM by  Stephan Linke [Paessler Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.