New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


PRTG Sensor Comments batch edit

Votes:

0

Your Vote:

Up

Down

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 by  chuestalani (0) 1

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



3 Replies

Votes:

0

Your Vote:

Up

Down

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

Your Vote:

Up

Down

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 by  chuestalani (0) 1



Votes:

0

Your Vote:

Up

Down

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]



Please log in or register to enter your reply.


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.