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

Adding threshholds to an advanced ssh sensor

Votes:

0

Hello,

I have an advanced ssh sensor that reads in all filesystems and checks if they are readonly. however if a new filesystem is added I need to adjust the thresholds manually which defeats the entire purpose of making the sensor generic. Is there an option in the XML to set a threshhold for upper limit since anything that is not 0 should give an error? Right now I just create a new channel for each filesystem and output 0 or 1. then I need to go to edit channel> enable limits > enter 0 in the upper limit. Can this be avoided and make a fully automatic sensor?

my xml output looks like this at the moment:

<prtg>
     <result>
          <channel>FS: /</channel>
          <value>0</value>
     </result>
     <result>
           <channel>FS: /u01</channel>
           <value>0</value>
     </result>
     <result>
            <channel>FS: /u02</channel>
            <value>0</value>
     </result>
     <result>
            <channel>FS: /u03</channel>
            <value>0</value>
      </result>
      <result>
            <channel>FS: /u04</channel>
            <value>0</value>
      </result>
      <result>
             <channel>FS: /u05</channel>
             <value>0</value>
      </result>
      <result>
             <channel>FS: /u06</channel>
             <value>0</value>
      </result>
</prtg>

prtg script ssh xml

Created on Mar 27, 2017 8:06:11 AM

Last change on Mar 27, 2017 9:39:05 AM by  Stephan Linke [Paessler Support]



3 Replies

Votes:

0

Channel limits are only applied during sensor creation, not at runtime. Any limit changes have to be done via API.

In general, this works like changing properties of any other object. To set channel properties via the API, you need to provide the ID of a sensor (parameter id), a subtype which is channel for channels, and a subid which is the ID of the channel you want to edit. For example /api/setobjectproperty.htm?id=2970&subid=0&subtype=channel&name=limitmaxerror&value=25 ...sets the upper error limit of a channel with the ID 0 of a sensor with the ID 2970 to the value 25.

Created on Mar 27, 2017 9:41:19 AM by  Stephan Linke [Paessler Support]



Votes:

0

But could this be done automatic? the API is great to make this change as easy as possible but right now it's more of an issue of not knowing when a new channel wil be added so I can't check the sensor every day to see if something new is there.

Created on Mar 28, 2017 7:10:56 AM



Votes:

0

Well, you could call this for each channel within a sensor: <prtg hostname>/editsettings?id=<sensor-id>&limitmode_<channel-id>=1

The limits itself can be simply updated by putting them in the channel output:

<prtg>
    <result>
        <channel>Test</channel>
        <value>122</value>
    </result>
    <result>
        <channel>Test 2</channel>
        <value>13</value>
    </result>
    <result>
        <channel>Test Limits</channel>
        <value>13</value>
        <LimitMinError>15</LimitMinError>
    </result>
</prtg>

The channels can be retrieved via /api/table.xml?content=channels&output=xml&columns=name,lastvalue_,id&id=2272&noraw=1&usecaption=true

You'll have to count them, though since they lack channel IDs. They start at 2 for custom sensors :)

Created on Mar 28, 2017 9:35:39 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.