summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakkalot <makkalot@gmail.com>2008-08-11 21:49:59 +0300
committermakkalot <makkalot@gmail.com>2008-08-11 21:49:59 +0300
commitc4499d441d342fd900760522c8d14ce2e6edd694 (patch)
treeea6a4f66bc760a07356614f9d8ab04c7a52434a3
parentd909c4909b3fa49e7b6ab94db940030f3c2fa95a (diff)
downloadfunc-c4499d441d342fd900760522c8d14ce2e6edd694.tar.gz
func-c4499d441d342fd900760522c8d14ce2e6edd694.tar.xz
func-c4499d441d342fd900760522c8d14ce2e6edd694.zip
export thesnmp module
-rw-r--r--func/minion/modules/snmp.py30
1 files changed, 29 insertions, 1 deletions
diff --git a/func/minion/modules/snmp.py b/func/minion/modules/snmp.py
index c992db1..c06655d 100644
--- a/func/minion/modules/snmp.py
+++ b/func/minion/modules/snmp.py
@@ -14,7 +14,7 @@ Abitrary command execution module for func.
"""
import func_module
-import sub_process
+from func.minion import sub_process
base_snmp_command = '/usr/bin/snmpget -v2c -Ov -OQ'
class Snmp(func_module.FuncModule):
@@ -32,7 +32,35 @@ class Snmp(func_module.FuncModule):
cmdref = sub_process.Popen(command.split(),stdout=sub_process.PIPE,stderr=sub_process.PIPE, shell=False)
data = cmdref.communicate()
return (cmdref.returncode, data[0], data[1])
+
+ def register_method_args(self):
+ """
+ Implementing the argument getter
+ """
+ return {
+ 'get':{
+ 'args':{
+ 'oid':{
+ 'type':'string',
+ 'optional':False,
+ 'description':'The oid'
+ },
+ 'rocommunity':{
+ 'type':'string',
+ 'optional':False,
+ 'description':"The rocommunity"
+ },
+ 'hostname':{
+ 'type':'string',
+ 'optional':True,
+ 'default':'localhost',
+ 'description':"The hostname tobe apllied on"
+ }
+ },
+ 'description':"Runs an snmpget on a specific oid returns the output of the call"
+ }
+ }
#def walk(self, oid, rocommunity):
#def table(self, oid, rocommunity):