Permalink
Browse files

IP-SLA Enumeration/Monitoring 1.2

git-svn-id: http://zenpacks.zenoss.org/svn/zenpacks@344 db08cffe-75b9-45d1-af1a-46ad9ef135f6
  • Loading branch information...
0 parents commit ca7ef11230e1ffddf5cecf6ea55ee147e8a562c6 Matt Ray committed Aug 23, 2009
@@ -0,0 +1,16 @@
+All files in this directory and below are:
+
+Copyright (c) 2009 Zenoss, Inc. All rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 as published
+by the Free Software Foundation.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -0,0 +1 @@
+graft ZenPacks
@@ -0,0 +1 @@
+__import__('pkg_resources').declare_namespace(__name__)
@@ -0,0 +1,52 @@
+#! /usr/bin/perl
+$what = shift(@ARGV);
+$community = shift(@ARGV);
+$verP = shift(@ARGV);
+$host = shift(@ARGV);
+$baseoid = "1.3.6.1.4.1.9.9.42.1.2.10.1";
+$timeout=5;
+
+use threads;
+use threads::shared;
+use Thread::Exit;
+
+my $done;
+
+$child_thread=threads->new(\&Call_Doit);
+$child_thread->detach();
+
+CallTimer();
+
+sub Call_Doit
+{
+
+ $name=`snmpwalk -c$community -$verP $host -O qv 1.3.6.1.4.1.9.9.42.1.2.1.1.3 | grep -m 1 -w '$what'`;
+ $id=`snmpwalk -c$community -$verP $host -O nqa 1.3.6.1.4.1.9.9.42.1.2.1.1.3 | grep -m 1 -w '$what'`;
+ $name=~ s/"//g;
+ $id=~s/"//g;
+ $id=~s/.1.3.6.1.4.1.9.9.42.1.2.1.1.3.//g;
+ $id=~s/$name//g;
+
+ $tmp=`snmpwalk -c$community -$verP $host -O vq $baseoid.1.$id`;
+ $response="rttMonLatestRttOperCompletionTime=$tmp";
+
+ $tmpB=`snmpwalk -c$community -$verP $host -O vq $baseoid.2.$id `;
+ $response="$response rttMonLatestRttOperSense=$tmpB";
+
+ $tmpC=`snmpwalk -c$community -$verP $host -O vq $baseoid.3.$id`;
+ $response=" $response rttMonLatestRttOperApplSpecificSense=$tmpC";
+
+ $tmpD=`snmpwalk -c$community -$verP $host -O vqt $baseoid.5.$id`;
+ $response=" $response rttMonLatestRttOperTime=$tmpD";
+
+ $response=~ s/\n//g;
+ $response=~ s/ //g;
+
+ print "OK| $response\n";
+ exit();
+}
+
+sub CallTimer
+{
+sleep $timeout;
+}
@@ -0,0 +1,55 @@
+#! /usr/bin/perl
+$what = shift(@ARGV);
+$community = shift(@ARGV);
+$verP = shift(@ARGV);
+$host = shift(@ARGV);
+$baseoid = "1.3.6.1.4.1.9.9.42.1.5.1.1";
+$timeout=5;
+
+use threads;
+use threads::shared;
+use Thread::Exit;
+
+my $done;
+
+$child_thread=threads->new(\&Call_Doit);
+$child_thread->detach();
+
+CallTimer();
+
+sub Call_Doit
+{
+
+ $name=`snmpwalk -c$community -$verP $host -O qv 1.3.6.1.4.1.9.9.42.1.2.1.1.3 | grep -m 1 -w '$what'`;
+ $id=`snmpwalk -c$community -$verP $host -O nqa 1.3.6.1.4.1.9.9.42.1.2.1.1.3 | grep -m 1 -w '$what'`;
+ $name=~ s/"//g;
+ $id=~s/"//g;
+ $id=~s/.1.3.6.1.4.1.9.9.42.1.2.1.1.3.//g;
+ $id=~s/$name//g;
+
+ $tmp=`snmpwalk -c$community -$verP $host -O vq $baseoid.1.$id`;
+ $response="rttMonLatestHTTPOperRTT=$tmp";
+
+ $tmpB=`snmpwalk -c$community -$verP $host -O vq $baseoid.2.$id `;
+ $response="$response rttMonLatestHTTPOperDNSRTT=$tmpB";
+
+ $tmpC=`snmpwalk -c$community -$verP $host -O vq $baseoid.3.$id `;
+ $response="$response rttMonLatestHTTPOperTCPConnectRTT=$tmpC";
+
+ $tmpD=`snmpwalk -c$community -$verP $host -O vq $baseoid.4.$id `;
+ $response="$response rttMonLatestHTTPOperTransactionRTT=$tmpD";
+
+ $tmpE=`snmpwalk -c$community -$verP $host -O vq $baseoid.6.$id `;
+ $response="$response rttMonLatestHTTPErrorSenseDescription=$tmpE";
+
+ $response=~ s/\n//g;
+ $response=~ s/ //g;
+
+ print "OK| $response\n";
+ exit();
+}
+
+sub CallTimer
+{
+sleep $timeout;
+}
@@ -0,0 +1,55 @@
+#! /usr/bin/perl
+$what = shift(@ARGV);
+$community = shift(@ARGV);
+$verP = shift(@ARGV);
+$host = shift(@ARGV);
+$baseoid = "1.3.6.1.4.1.9.9.42.1.5.2.1";
+$timeout=5;
+
+use threads;
+use threads::shared;
+use Thread::Exit;
+
+my $done;
+
+$child_thread=threads->new(\&Call_Doit);
+$child_thread->detach();
+
+CallTimer();
+
+sub Call_Doit
+{
+
+ $name=`snmpwalk -c$community -$verP $host -O qv 1.3.6.1.4.1.9.9.42.1.2.1.1.3 | grep -m 1 -w '$what'`;
+ $id=`snmpwalk -c$community -$verP $host -O nqa 1.3.6.1.4.1.9.9.42.1.2.1.1.3 | grep -m 1 -w '$what'`;
+ $name=~ s/"//g;
+ $id=~s/"//g;
+ $id=~s/.1.3.6.1.4.1.9.9.42.1.2.1.1.3.//g;
+ $id=~s/$name//g;
+
+ $tmp=`snmpwalk -c$community -$verP $host -O vq $baseoid.46.$id`;
+ $response="rttMonLatestJitterOperAvgJitter=$tmp";
+
+ $tmpB=`snmpwalk -c$community -$verP $host -O vq $baseoid.42.$id `;
+ $response="$response rttMonLatestJitterOperMOS=$tmpB";
+
+ $tmpC=`snmpwalk -c$community -$verP $host -O vq $baseoid.43.$id `;
+ $response="$response rttMonLatestJitterOperICPIF=$tmpC";
+
+ $tmpD=`snmpwalk -c$community -$verP $host -O vq $baseoid.44.$id `;
+ $response="$response rttMonLatestJitterOperIAJOut=$tmpD";
+
+ $tmpE=`snmpwalk -c$community -$verP $host -O vq $baseoid.45.$id `;
+ $response="$response rttMonLatestJitterOperIAJIn=$tmpE";
+
+ $response=~ s/\n//g;
+ $response=~ s/ //g;
+
+ print "OK| $response\n";
+ exit();
+}
+
+sub CallTimer
+{
+sleep $timeout;
+}
@@ -0,0 +1,29 @@
+from Globals import InitializeClass
+from Products.ZenModel.Device import Device
+from Products.ZenModel.ZenossSecurity import ZEN_VIEW, ZEN_CHANGE_SETTINGS
+from Products.ZenRelations.RelSchema import *
+
+import copy
+
+class SLADevice(Device):
+ "Service Level Agreement Panel"
+
+ _relations = Device._relations + (
+ ('ipSLAs', ToManyCont(ToOne,
+ "ZenPacks.ipSLA.SLADevice.SLAS", "host")),
+ )
+
+ factory_type_information = copy.deepcopy(Device.factory_type_information)
+ custom_actions = []
+ custom_actions.extend(factory_type_information[0]['actions'])
+ custom_actions.insert(2,
+ { 'id' : 'SLADevice'
+ , 'name' : 'Service Level Agreement'
+ , 'action' : 'ipSLAipSlaDevice'
+ , 'permissions' : (ZEN_VIEW,) },
+ )
+ factory_type_information[0]['actions'] = custom_actions
+
+ def __init__(self, *args, **kw):
+ Device.__init__(self, *args, **kw)
+ self.buildRelations()
Oops, something went wrong.

0 comments on commit ca7ef11

Please sign in to comment.