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

Why is my bash script that we run in cygwin to update sensor comments which USED TO BE WORKING few d

Votes:

0

Comment Tab Output:

This is a Front Office L2 Support sensor. Runbook: http://servicedesk/CAisd/pdmweb.exe?OP=SHOW_DETAIL+PERSID=KD:409413+HTMPL=kt_document_view.htmpl+open_mode=2

Bash Script:

#!/bin/bash
groupID=81601
uname=_name.surname
hash=*********
runbookURL=http://servicedesk/CAisd/pdmweb.exe?OP=SHOW_DETAIL+PERSID=KD:409413+HTMPL=kt_document_view.htmpl+open_mode=2
prtgURL=`echo $runbookURL | sed -e 's/+/%2b/g'`
output="This is a Front Office L2 Support 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

bash-script comments cygwin group

Created on Jul 7, 2015 12:25:23 AM

Last change on Jul 7, 2015 8:04:14 AM by  Stephan Linke [Paessler Support]



1 Reply

Votes:

0

What exact problems do you have with that sensor? It's better to but the error description in the text field rather than the thread title :)

Created on Jul 7, 2015 8:05:12 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.