Thread Net::Telnet - Slots von Extreme Black Diamond Switch abfragen (23 answers)
Opened by affe at 2010-08-24 15:02

hund
 2010-08-24 15:23
#140898 #140898
User since
2010-08-24
13 Artikel
BenutzerIn
[default_avatar]
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use strict;
use warnings;
use Net::Telnet;
use Nagios::Plugin;


my $host ="nagios";
my $password ="nagios";


#nagios
my $np = Nagios::Plugin->new(
        usage =>
"Usage: %s [-H <host>] [-h <help>] [-p <password>]",
        shortname => "check_slot",
        license => 'This nagios plugin is free software, and comes with ABSOLUTELY
                                NO WARRANTY. It may be used, redistributed and/or modified under
                                the terms of the GNU General Public Licence (see
                                http://www.fsf.org/licensing/licenses/gpl.txt).',
        blurb =>'(contact Michael.Sonnnenburg@provaris.de)',
);
$np->add_arg(
        spec     => 'host|H=s',
        help     => '-H, --host=STRING\n',
        required => '0',
);
$np->add_arg(
        spec     => 'help|h=s',
        help     => '-h, --help=STRING\n',
        required => '0',
);
$np->add_arg(
        spec     => 'password|p=s',
        help     => '-p, --password=STRING\n',
        required => '0',
);
$np->getopts;


$host =                 ( defined( $np->opts->host )            ? $np->opts->host : $host );
$password =     ( defined( $np->opts->password )        ? $np->opts->password : $password );


        my $t = new Net::Telnet (Timeout => 10,
                              Prompt => '/Provaris GmbH/');
        $t->open("10.0.10.61");
        $t->login($host, $password);
        my @lines = $t->cmd("show slot");
        print @lines;


hier was ich bisher habe.

als meldung bekomme ich ein timeout ,wenn ich den befehl show slot änder bekomme ich eine ausgabe...


mod-edit pq: perl-tags hinzugefügt
Last edited: 2010-08-24 15:26:35 +0200 (CEST)

View full thread Net::Telnet - Slots von Extreme Black Diamond Switch abfragen