Forum Discussion

Henrik_Grevelun's avatar
4 years ago

Graph that shows the number of disks in system


I use SNMP to gather information from a number of linux machines. They are used as backup proxies using hot-add.
I would like to create a graph showing the number of disk each proxy has mountet.
I would also like to be able to create an alert if the number of disks doesn't return to to normal after 12 hours, but thats another question..

So how do i count the number of disk in the widget on the dashboard ?
With SNMP i get the DISK IO / Physical / Instances (1 instance pr disk and partition SDA, SDA1, SDA2, SDB)

Have a nice day,

3 Replies

  • You cannot use a straight SNMP check for this, but you can use a SNMP via Groovy to enumerate the disks and generate the sum as a datapoint value. There are many datasources that access SNMP via Groovy you can use as examples -- a quick search of our backups shows HP_Chassis_MemoryModules among many others.  You will want to focus on this OID -


  • Anonymous's avatar

    There are several ways to do this, but the best (IMO) is to create your own DataSource that pulls the list of disks and counts them. The output would be the number of mounted disks. You could then put static or dynamic thresholds on that number to generate the appropriate alerts.

    The NetSNMPdiskIO pulls the list of disks via SNMP using the OID . You could pretty easily write a script to walk that OID and count up the various disks. 

    @mnagel beat me to it. Here's what it might look like:

    import com.santaba.agent.groovyapi.snmp.Snmp
    def hostname = hostProps.get('system.hostname')
    def props = hostProps.toProperties()
    def snmp_timeout = 10000
    def snmp_oid = '.'
    disk_count = 0
    try {
      x = Snmp.walk(hostname, snmp_oid, props, snmp_timeout)
      return 0
    } catch (Exception e){println(e);return 1}    


  • Hi Stuart,

    "Great minds think alike. So, if we disagree, one of us doesn't have a great mind." ?

    Thanks for the answer, it seems to do exaclty what i  wanted to do. I will go ahead and try to create my own (first) datasource.


    Have a nice day,