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


Extraction sensor and channel

Votes:

0

Your Vote:

Up

Down

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&[email protected](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 by  TIBCO-PRTG (0) 1

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



9 Replies

Votes:

0

Your Vote:

Up

Down

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

Your Vote:

Up

Down

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



Votes:

0

Your Vote:

Up

Down

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=*&[email protected](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

Your Vote:

Up

Down

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



Votes:

0

Your Vote:

Up

Down

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

Your Vote:

Up

Down

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



Votes:

0

Your Vote:

Up

Down

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

Your Vote:

Up

Down

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



Votes:

0

Your Vote:

Up

Down

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 by  lordmilko (1,512) 2 1



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.