1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

- have some dirs

This commit is contained in:
Steve Schnepp 2012-02-13 18:24:46 +01:00
parent 0b089ea777
commit 08346aac58
687 changed files with 0 additions and 0 deletions

52
plugins/netapp/netapp_cifs Executable file
View file

@ -0,0 +1,52 @@
#!/usr/bin/env python
"""Thomas R. N. Jansson (tjansson@tjansson.dk)
16-MAY-2010
"""
# The SNMP traps for the NetApp filer can be found in
# /net/netappfiler/vol0/etc/mib/traps.dat if the filer is
# NFS automounted mounted on server.
# Example: the SNMP id for cpuBusyTimePerCent is
# snmp.1.3.6.1.4.1.789.1.2.1.3.0
# and retrival of this value is done by
# snmpget -v 1 -c public netappfiler 1.3.6.1.4.1.789.1.2.1.3.0
#
# Requires snmpget and assumes public community.
import commands
import sys
# Provided a servername and a snmpid it returns the value stripped of bogus information.
def snmpget(iservername,isnmpid):
runcmd = 'snmpget -v 1 -c public ' + iservername + ' ' + isnmpid
output = commands.getoutput(runcmd)
return output.split()[3]
# The interface number corresponds to vif1 on the tested netapp
servername = sys.argv[0].split('_')[2]
cifsConnectedUsers = '1.3.6.1.4.1.789.1.7.2.9.0'
cifsNSessions = '1.3.6.1.4.1.789.1.7.2.12.0'
cifsNOpenFiles = '1.3.6.1.4.1.789.1.7.2.13.0'
# Using config
if len(sys.argv) == 2 and sys.argv[1] == "config":
print 'graph_title CIFS usage on '+servername
print 'graph_args --base 1000 -l 0'
print 'graph_vlabel number'
print 'graph_category netapp'
print 'graph_info This graph shows CIFS usage on '+servername
print 'cifsConnectedUsers.label ConnectedUsers'
print 'cifsConnectedUsers.info The curent number of CIFS users on the filer'
print 'cifsNSessions.label NumberOfSessions'
print 'cifsNSessions.info The current number of active CIFS session on the filer'
print 'cifsNOpenFiles.label NumberOfOpenfiles'
print 'cifsNOpenFiles.info The number of open CIFS files and directories on the filer'
sys.exit(0)
# Gathers info from the servers and gathers data
print 'cifsConnectedUsers.value '+snmpget(servername,cifsConnectedUsers)
print 'cifsNSessions.value '+snmpget(servername,cifsNSessions)
print 'cifsNOpenFiles.value '+snmpget(servername,cifsNOpenFiles)

47
plugins/netapp/netapp_cpu_ Executable file
View file

@ -0,0 +1,47 @@
#!/usr/bin/env python
"""Thomas R. N. Jansson (tjansson@tjansson.dk)
16-MAY-2010
"""
# The SNMP traps for the NetApp filer can be found in
# /net/netappfiler/vol0/etc/mib/traps.dat if the filer is
# NFS automounted mounted on server.
# Example: the SNMP id for cpuBusyTimePerCent is
# snmp.1.3.6.1.4.1.789.1.2.1.3.0
# and retrival of this value is done by
# snmpget -v 1 -c public netappfiler 1.3.6.1.4.1.789.1.2.1.3.0
#
# Requires snmpget and assumes public community.
import commands
import sys
# Provided a servername and a snmpid it returns the value stripped of bogus information.
def snmpget(iservername,isnmpid):
runcmd = 'snmpget -v 1 -c public ' + iservername + ' ' + isnmpid
output = commands.getoutput(runcmd)
return output.split()[3]
snmpid = "1.3.6.1.4.1.789.1.2.1.3.0"
warning = 80
critical = 95
servername = sys.argv[0].split('_')[2]
if len(sys.argv) == 2 and sys.argv[1] == "config":
print 'graph_title CPU usage on', servername
print 'graph_args --base 1000 -r --lower-limit 0 --upper-limit 100'
print 'graph_vlabel %'
print 'graph_scale no'
print 'graph_info This graph shows how CPU time is spent.'
print 'graph_period second'
print 'graph_category netapp'
print 'usage.label cpu_usage '
print 'usage.draw STACK'
print 'usage.warning ', warning
print 'usage.critical ', critical
print 'usage.info CPU time spent by normal programs and daemons'
sys.exit(0)
# Gathers info from the servers and gathers data
print 'usage.value '+snmpget(servername,snmpid)

67
plugins/netapp/netapp_if_ Executable file
View file

@ -0,0 +1,67 @@
#!/usr/bin/env python
"""Thomas R. N. Jansson (tjansson@tjansson.dk)
16-MAY-2010
"""
# The SNMP traps for the NetApp filer can be found in
# /net/netappfiler/vol0/etc/mib/traps.dat if the filer is
# NFS automounted mounted on server.
# Example: the SNMP id for cpuBusyTimePerCent is
# snmp.1.3.6.1.4.1.789.1.2.1.3.0
# and retrival of this value is done by
# snmpget -v 1 -c public netappfiler 1.3.6.1.4.1.789.1.2.1.3.0
#
# Requires snmpget and assumes public community.
import commands
import sys
import time
# Provided a servername and a snmpid it returns the value stripped of bogus information.
def snmpget(iservername,isnmpid):
runcmd = 'snmpget -v 1 -c public ' + iservername + ' ' + isnmpid
output = commands.getoutput(runcmd)
return output.split()[3]
# Calculates the bps by asking twice divided per second.
def calcbps(iservername,isnmpid):
val_first = int(snmpget(iservername,isnmpid))
time.sleep(1)
val_second = int(snmpget(iservername,isnmpid))
return str(val_second-val_first)
# The interface number corresponds to vif1 on my netapp
iface = '8'
ifEntryDescr = '1.3.6.1.2.1.2.2.1.2.'+iface
ifEntrySpeed = '1.3.6.1.2.1.2.2.1.5.'+iface
ifEntryStatus = '1.3.6.1.2.1.2.2.1.8.'+iface
ifEntryInOctets = '1.3.6.1.2.1.2.2.1.10.'+iface
ifEntryOutOctets = '1.3.6.1.2.1.2.2.1.16.'+iface
servername = sys.argv[0].split('_')[2]
ifacename = snmpget(servername,ifEntryDescr)
if len(sys.argv) == 2 and sys.argv[1] == "config":
print 'graph_title Network usage on '+servername+' inteface '+ifacename
print 'graph_order recv send'
print 'graph_args --base 1000'
print 'graph_vlabel bits in (-) / out (+) per \${graph_period}'
print 'graph_category netapp'
print 'graph_info This graph shows traffic for the '+ifacename+' network interface.'
print 'recv.label recv'
print 'recv.graph no'
print 'recv.cdef recv,8,*'
print 'recv.max 2000000000'
print 'recv.min 0'
print 'send.info Bits sent/received by the '+ifacename+' interface.'
print 'send.label bps'
print 'send.negative recv'
print 'send.cdef send,8,*'
print 'send.max 2000000000'
print 'send.min 0'
sys.exit(0)
# Gathers info from the servers and gathers data
print 'send.value '+calcbps(servername,ifEntryOutOctets)
print 'recv.value '+str(int(calcbps(servername,ifEntryInOctets))*-1)