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

Extraction sensor and channel

Votes:

0

I would like to know if you have the possibility of obtaining particular information by extraction, I explain. On my servers, I use the Windows Free Space sensor which lists the partitions to know what remains in free space and to which I added a tag "Disque_Mine" to find the discs that I wish to follow more particularly. I am able to extract a list of disk with a warning status but I miss information that I can not extract, the free bytes (in G-bytes) and the sum.

Could you help me ?

Here is the link that I was able to produce at the moment:

/api/table.xml?content=sensors&output=csvtable&columns=probe,device,sensor,objid,status,message&filter_status=4&filter_tags=@tag(Disque_Mine)

(PS : sorry if my english is not good)

api channels disk-free extraction prtg sensor table

Created on Feb 3, 2017 10:50:48 AM

Last change on Feb 3, 2017 11:46:38 AM by  Luciano Lingnau [Paessler]



9 Replies

Votes:

0

Dear TIBCO

Using the column lastvalue you can show the current value of the primary channel. You can get all channels from a given sensor, this example uses sensor ID 2123:

/api/table.xml?id=2123&content=channels&columns=objid,name,lastvalue

Created on Feb 3, 2017 12:25:22 PM by  Arne Seifert [Paessler Support]

Last change on Feb 3, 2017 12:47:07 PM by  Arne Seifert [Paessler Support]



Votes:

0

Hi Arne Seifert, Thanks for your replie. With this api, it is valid only for a single sensor identified by its ID. I would like to be able to extract all the sensors for which I added a tag (Disque_Mine) and to show the channels in this extraction. Is it possible ?

Created on Feb 3, 2017 12:34:38 PM



Votes:

0

Dear TIBCO

This cannot be done in a single call. First, you have to generate a list of sensors filtered via tag:

/api/table.xml?content=sensors&columns=objid,name&count=*&filter_tags=@tag(Disque_Mine)

In the second step you have to iterate over the objid numbers and get the channel list for each sensor.

Created on Feb 3, 2017 12:52:33 PM by  Arne Seifert [Paessler Support]



Votes:

0

After that, is it possible to output the information with an ID range to get channel information or is it only possible to do it one by one?

Because I have a hundred server to supervise and I need to leave this information there to know that this sensor (which has the tag (Disque_Mine)) is in warning and that it remains xxGo of free on xxTo in all.

You see what I mean ?

Created on Feb 3, 2017 1:04:12 PM



Votes:

0

To get channel data, you have to do it sensor by sensor. While this is impractical for manual use, you could write a script which does that.

Created on Feb 3, 2017 1:10:56 PM by  Arne Seifert [Paessler Support]



Votes:

0

Would you have a track to give me because my server prtg is under windows and I do not master Powershell well?

Created on Feb 3, 2017 1:19:06 PM



Votes:

0

Dear TIBCO

We have no fully-fledged example script. However the core of the script would be a line of code similar to this:

[xml]$xmlresult = (new-object System.Net.WebClient).downloadstring($url)

This command returns the table as XML object so that you can directly access the XML nodes through the object properties.

The $url variable must contain the API call. The API call should also include authentication credentials. Please read more about the API usage via the menus Setup | PRTG API, tab "HTTP API".

Created on Feb 3, 2017 1:34:04 PM by  Arne Seifert [Paessler Support]

Last change on Feb 3, 2017 1:34:48 PM by  Arne Seifert [Paessler Support]



Votes:

0

It does not help me much! I will work on it and see if I get to what I want as I do not have much time in my days to search for the solution. I will return you a return to term (I think it takes time). Thank you for your help

Created on Feb 3, 2017 2:02:14 PM



Votes:

0

For reference, this can be done fairly easily with PrtgAPI

C:\> Get-Sensor -Tags Disque_Mine | Get-Channel *bytes*

Name                      SensorId     Id     LastValue LimitsEnabled UpperErrorLimit LowerErrorLimit
----                      --------     --     --------- ------------- --------------- ---------------
Free Bytes C:             2802          4  30,375 MByte         False
Free Bytes C:             2866          4       No data         False

The last "display value" can be retrieved via the LastValue property. To get the last value in bytes, you can access the LastValueNumeric property

Regards, lordmilko

Created on Feb 5, 2018 4:56:02 AM




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.