Projet

Général

Profil

Révision 4fac7e61

ID4fac7e61b88c3c367084e574d3c5b12468761902
Parent 08479bda
Enfant c77e4589

Ajouté par jmdevince il y a environ 10 ans

Plugin monitoring CPU on Cisco SB Devices

Voir les différences:

plugins/snmp/snmp__cisco_sbs_cpu
1
#!/usr/bin/perl -w
2
# -*- perl -*-
3
# vim: ft=perl
4

  
5
=head1 NAME
6

  
7
snmp__cisco_sbs_cpu - Munin plugin to monitor CPU Usage on Cisco Small Business Switches.
8

  
9
=head1 APPLICABLE SYSTEMS
10

  
11
Cisco Small Business Switches (SBXXXX devices)
12

  
13
=head1 CONFIGURATION
14

  
15
As a rule SNMP plugins need site specific configuration.  The default
16
configuration (shown here) will only work on insecure sites/devices.
17

  
18
   [snmp_*]
19
        env.version 2
20
        env.community public
21

  
22
In general SNMP is not very secure at all unless you use SNMP version
23
3 which supports authentication and privacy (encryption).  But in any
24
case the community string for your devices should not be "public".
25

  
26
Please see 'perldoc Munin::Plugin::SNMP' for further configuration
27
information.
28

  
29
=head1 INTERPRETATION
30

  
31
CPU Percentage gives an idea of utilization of the device. High CPU
32
can indicate a configuration problem or overutilization of the device.
33

  
34
=head1 MAGIC MARKERS
35

  
36
  #%# family=snmpauto
37
  #%# capabilities=snmpconf
38

  
39
=head1 VERSION
40

  
41
  $Id$
42

  
43
=head1 BUGS
44

  
45
None known.
46

  
47
=head1 AUTHOR
48

  
49
Copyright (C) 2015 James DeVincentis
50

  
51
=head1 LICENSE
52

  
53
GPLv3.
54

  
55
=cut
56

  
57
use strict;
58
use Munin::Plugin::SNMP;
59

  
60
if (defined $ARGV[0] and $ARGV[0] eq 'snmpconf') {
61
        print "require 1.3.6.1.4.1.9.6.1.101.1.7.0 [0-9]\n";
62
        exit 0;
63
}
64

  
65
if (defined $ARGV[0] and $ARGV[0] eq "config") {
66
        my ($host) = Munin::Plugin::SNMP->config_session();
67

  
68
        print "host_name $host\n" unless $host eq 'localhost';
69
        print <<"EOF";
70
graph_title CPU Utilization
71
graph_args --base 1000 -l 0 -u 100
72
graph_vlabel CPU %
73
graph_category system
74
graph_info This graph shows the percentage of CPU used at different intervals. High CPU Utilization can indicate a configuration problem or overutilization of the device.
75
load5sec.label 5s
76
load5sec.info 5 Second CPU Utilization Average
77
load5sec.draw LINE1
78
load1min.label 1m
79
load1min.info 1 Minute CPU Utilization Average
80
load1min.draw LINE1
81
load5min.label 5m
82
load5min.info 5 Minute CPU Utilization Average
83
EOF
84
        exit 0;
85
}
86

  
87
my $session = Munin::Plugin::SNMP->session();
88
print "load5sec.value ", $session->get_single('1.3.6.1.4.1.9.6.1.101.1.7.0'), "\n";
89
print "load1min.value ", $session->get_single('1.3.6.1.4.1.9.6.1.101.1.8.0'), "\n";
90
print "load5min.value ", $session->get_single('1.3.6.1.4.1.9.6.1.101.1.9.0'), "\n";

Formats disponibles : Unified diff