Forum Discussion
Anonymous
4 years agoThere 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 .1.3.6.1.4.1.2021.13.15.1.1.2. 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 = '.1.3.6.1.4.1.2021.13.15.1.1.2' disk_count = 0 try { x = Snmp.walk(hostname, snmp_oid, props, snmp_timeout) println(x) println(x.split('\n').size()) return 0 } catch (Exception e){println(e);return 1}
Related Content
- 2 years agoAnonymous
- 2 years ago