Sunday, May 19th 2013, 3:38am UTC+2
You are not logged in.
Birthday: Sep 29th 1970 (42)
Gender: male
Location: Koblenz
Occupation: Sys-Admin
Number of monitoring servers: 7
Nagios Version: 3.2.3
Distributed monitoring: Ja
Redundant monitoring: Ja
Number of hosts: ~1100
Number of services: ~10000
OS: Debian Lenny, Ubuntu 8.04 LTS
Plugin Version: 1.4.13
NagVis Version: 1.7.6
NDO Version: 1.5
Other Addons: PNP (V. 0.6.21), Multicheck (V 0.26), mod_gearman (V 1.4.2), DokuWiki, Trap2Mod_Gearman (V 1.5)
Birthday: Sep 29th 1970 (42)
Gender: male
Location: Koblenz
Occupation: Sys-Admin
Number of monitoring servers: 7
Nagios Version: 3.2.3
Distributed monitoring: Ja
Redundant monitoring: Ja
Number of hosts: ~1100
Number of services: ~10000
OS: Debian Lenny, Ubuntu 8.04 LTS
Plugin Version: 1.4.13
NagVis Version: 1.7.6
NDO Version: 1.5
Other Addons: PNP (V. 0.6.21), Multicheck (V 0.26), mod_gearman (V 1.4.2), DokuWiki, Trap2Mod_Gearman (V 1.5)
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
ALARM REPORT
Port Maintenance On Alt Alarm Svc Ack? Date Date
Name Brd? Name Type State 1 2 Alarmed Resolved
S00001 DIG-IP-S n 1121 WARNING OUT 02/17/16:01 00/00/00:00
S00003 DIG-IP-S n 3810 WARNING OUT 02/17/16:01 00/00/00:00
S00018 DIG-IP-S n 3811 WARNING OUT 02/17/16:01 00/00/00:00
S00043 DIG-IP-S n 3812 WARNING OUT 02/17/16:01 00/00/00:00
S00059 DIG-IP-S n 3800 WARNING OUT 02/17/16:01 00/00/00:00
S00060 DIG-IP-S n 3801 WARNING OUT 02/17/16:01 00/00/00:00
S00061 DIG-IP-S n 3802 WARNING OUT 02/17/16:01 00/00/00:00
S00062 DIG-IP-S n 3803 WARNING OUT 02/17/16:01 00/00/00:00
S00064 DIG-IP-S n 3805 WARNING OUT 02/17/16:01 00/00/00:00
S00065 DIG-IP-S n 3806 WARNING OUT 02/17/16:01 00/00/00:00
S00066 DIG-IP-S n 3807 WARNING OUT 02/17/16:01 00/00/00:00
S00067 DIG-IP-S n 3808 WARNING OUT 02/17/16:01 00/00/00:00
S00068 DIG-IP-S n 3809 WARNING OUT 02/17/16:01 00/00/00:00
S00070 DIG-IP-S n 1001 WARNING OUT 02/17/16:01 00/00/00:00
|
|
|
Source code |
1 |
S00001 DIG-IP-S n 1121 WARNING OUT 02/17/16:01 00/00/00:00 |
Location: Esslingen
Number of monitoring servers:
Nagios Version:
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts:
Number of services:
OS:
Plugin Version:
NagVis Version:
NDO Version:
Perfparse Version:
Other Addons:
Hat vielleicht einer für mich einen Ansatz wie ich jede einzelne Zeile in einen Array geschrieben bekomme?
|
|
Source code |
1 2 3 4 5 6 7 8 9 |
use Data::Dumper;
my @array=();
my $c=0;
while (<>) {
if (/^S\d+/) {
push @{$array[$c++]}, (split(/\s+/));
}
}
print Dumper(\@array);
|
|
|
Source code |
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 |
$ perl /tmp/testarray.pl
S00066 DIG-IP-S n 3807 WARNING OUT 02/17/16:01 00/00/00:00
S00067 DIG-IP-S n 3808 WARNING OUT 02/17/16:01 00/00/00:00
S00068 DIG-IP-S n 3809 WARNING OUT 02/17/16:01 00/00/00:00
S00070 DIG-IP-S n 1001 WARNING OUT 02/17/16:01 00/00/00:00
$VAR1 = [
[
'S00066',
'DIG-IP-S',
'n',
'3807',
'WARNING',
'OUT',
'02/17/16:01',
'00/00/00:00'
],
[
'S00067',
'DIG-IP-S',
'n',
'3808',
'WARNING',
'OUT',
'02/17/16:01',
'00/00/00:00'
],
[
'S00068',
'DIG-IP-S',
'n',
'3809',
'WARNING',
'OUT',
'02/17/16:01',
'00/00/00:00'
],
[
'S00070',
'DIG-IP-S',
'n',
'1001',
'WARNING',
'OUT',
'02/17/16:01',
'00/00/00:00'
]
];
|

Birthday: Sep 29th 1970 (42)
Gender: male
Location: Koblenz
Occupation: Sys-Admin
Number of monitoring servers: 7
Nagios Version: 3.2.3
Distributed monitoring: Ja
Redundant monitoring: Ja
Number of hosts: ~1100
Number of services: ~10000
OS: Debian Lenny, Ubuntu 8.04 LTS
Plugin Version: 1.4.13
NagVis Version: 1.7.6
NDO Version: 1.5
Other Addons: PNP (V. 0.6.21), Multicheck (V 0.26), mod_gearman (V 1.4.2), DokuWiki, Trap2Mod_Gearman (V 1.5)

Location: Esslingen
Number of monitoring servers:
Nagios Version:
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts:
Number of services:
OS:
Plugin Version:
NagVis Version:
NDO Version:
Perfparse Version:
Other Addons:
Ich verstehe nur gerade nicht wie ich die Daten in diese While-Schleife bekomme.
Die Ausgabe von meiner Abfrage steht zur Zeit in der Variable "$inputstring"...
Was muss ich denn ändern damit diese Whileschleife dort greift...

|
|
Source code |
1 |
while (shift(@inputstrings)) {...
|
|
|
Source code |
1 |
for (@inputstrings) {...
|
Birthday: Sep 29th 1970 (42)
Gender: male
Location: Koblenz
Occupation: Sys-Admin
Number of monitoring servers: 7
Nagios Version: 3.2.3
Distributed monitoring: Ja
Redundant monitoring: Ja
Number of hosts: ~1100
Number of services: ~10000
OS: Debian Lenny, Ubuntu 8.04 LTS
Plugin Version: 1.4.13
NagVis Version: 1.7.6
NDO Version: 1.5
Other Addons: PNP (V. 0.6.21), Multicheck (V 0.26), mod_gearman (V 1.4.2), DokuWiki, Trap2Mod_Gearman (V 1.5)
Birthday: Sep 29th 1970 (42)
Gender: male
Location: Koblenz
Occupation: Sys-Admin
Number of monitoring servers: 7
Nagios Version: 3.2.3
Distributed monitoring: Ja
Redundant monitoring: Ja
Number of hosts: ~1100
Number of services: ~10000
OS: Debian Lenny, Ubuntu 8.04 LTS
Plugin Version: 1.4.13
NagVis Version: 1.7.6
NDO Version: 1.5
Other Addons: PNP (V. 0.6.21), Multicheck (V 0.26), mod_gearman (V 1.4.2), DokuWiki, Trap2Mod_Gearman (V 1.5)
|
|
Source code |
1 |
^[[9;0H |
|
|
Source code |
1 |
^[[ZAHL;ZAHLH |
|
|
Source code |
1 |
$inputstring =~ s/\[\d+;\d+H//g; |
|
|
Source code |
1 |
^[ |
This post has been edited 1 times, last edit by "TheCry" (Mar 9th 2010, 2:10pm)
Location: Esslingen
Number of monitoring servers:
Nagios Version:
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts:
Number of services:
OS:
Plugin Version:
NagVis Version:
NDO Version:
Perfparse Version:
Other Addons:
|
|
Source code |
1 |
$inputstring =~ s/[^[:ascii:]]+//g; |

Birthday: Sep 29th 1970 (42)
Gender: male
Location: Koblenz
Occupation: Sys-Admin
Number of monitoring servers: 7
Nagios Version: 3.2.3
Distributed monitoring: Ja
Redundant monitoring: Ja
Number of hosts: ~1100
Number of services: ~10000
OS: Debian Lenny, Ubuntu 8.04 LTS
Plugin Version: 1.4.13
NagVis Version: 1.7.6
NDO Version: 1.5
Other Addons: PNP (V. 0.6.21), Multicheck (V 0.26), mod_gearman (V 1.4.2), DokuWiki, Trap2Mod_Gearman (V 1.5)
|
|
Source code |
1 2 3 4 5 |
$inputstring =~ s/\e\[\d+;\d+H/XXX/g;
$inputstring =~ s/XXX(\d+)XXX/$1/g;
$inputstring =~ s/(\d+)XXX\//$1\//g;
$inputstring =~ s/(\d+)XXX:(\b[0-9]{1,2})/$1:$2 /g;
$inputstring =~ s/XXX/ /g;
|
Location: Esslingen
Number of monitoring servers:
Nagios Version:
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts:
Number of services:
OS:
Plugin Version:
NagVis Version:
NDO Version:
Perfparse Version:
Other Addons:
Auf Ubuntu 8.04 habe ich noch kein Perl 5.10 drauf und laute MCPAN ist POSIX ein Teil davon...

Birthday: Sep 29th 1970 (42)
Gender: male
Location: Koblenz
Occupation: Sys-Admin
Number of monitoring servers: 7
Nagios Version: 3.2.3
Distributed monitoring: Ja
Redundant monitoring: Ja
Number of hosts: ~1100
Number of services: ~10000
OS: Debian Lenny, Ubuntu 8.04 LTS
Plugin Version: 1.4.13
NagVis Version: 1.7.6
NDO Version: 1.5
Other Addons: PNP (V. 0.6.21), Multicheck (V 0.26), mod_gearman (V 1.4.2), DokuWiki, Trap2Mod_Gearman (V 1.5)
Birthday: Sep 29th 1970 (42)
Gender: male
Location: Koblenz
Occupation: Sys-Admin
Number of monitoring servers: 7
Nagios Version: 3.2.3
Distributed monitoring: Ja
Redundant monitoring: Ja
Number of hosts: ~1100
Number of services: ~10000
OS: Debian Lenny, Ubuntu 8.04 LTS
Plugin Version: 1.4.13
NagVis Version: 1.7.6
NDO Version: 1.5
Other Addons: PNP (V. 0.6.21), Multicheck (V 0.26), mod_gearman (V 1.4.2), DokuWiki, Trap2Mod_Gearman (V 1.5)
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 |
[
'S00001',
'DIG-IP-S',
'n',
'1121',
'WARNING',
'OUT',
'02/17/16:01',
'00/00/00:00'
],
|
Location: Kassel
Occupation: Sysadmin SAP / Linux / AIX
Number of monitoring servers: 2
Hobbies: Motorrad fahren, wenns die Zeit erlaubt :-)
Nagios Version: 3.2.3 ( OMD )
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts: 360
Number of services: 6700
OS: Debian 6.0
Plugin Version: 1.4.x
Other Addons: SNMPTT, NagTrap, check_mk, PNP-0.6.x. Thruk
Birthday: Sep 29th 1970 (42)
Gender: male
Location: Koblenz
Occupation: Sys-Admin
Number of monitoring servers: 7
Nagios Version: 3.2.3
Distributed monitoring: Ja
Redundant monitoring: Ja
Number of hosts: ~1100
Number of services: ~10000
OS: Debian Lenny, Ubuntu 8.04 LTS
Plugin Version: 1.4.13
NagVis Version: 1.7.6
NDO Version: 1.5
Other Addons: PNP (V. 0.6.21), Multicheck (V 0.26), mod_gearman (V 1.4.2), DokuWiki, Trap2Mod_Gearman (V 1.5)
Quoted
Zugreifen wuerdest du dann mit $array[$zeilennummer][$feldnummer]. Assoziativ ginge das natuerlich auch, aber das kommt auf deine Anforderungen an
|
|
Source code |
1 |
push @{$ALARMROWS[$c++]}, (split(/\s+/,$ALARMROW));
|
Birthday: Sep 29th 1970 (42)
Gender: male
Location: Koblenz
Occupation: Sys-Admin
Number of monitoring servers: 7
Nagios Version: 3.2.3
Distributed monitoring: Ja
Redundant monitoring: Ja
Number of hosts: ~1100
Number of services: ~10000
OS: Debian Lenny, Ubuntu 8.04 LTS
Plugin Version: 1.4.13
NagVis Version: 1.7.6
NDO Version: 1.5
Other Addons: PNP (V. 0.6.21), Multicheck (V 0.26), mod_gearman (V 1.4.2), DokuWiki, Trap2Mod_Gearman (V 1.5)
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
$VAR1 = [
[
'',
'121',
'MED-GTWY',
'n',
'MINOR',
'n',
'03/11/08:08',
'00/00/00:00'
],
[
'',
'121',
'MED-GTWY',
'n',
'MINOR',
'n',
'03/11/08:08',
'00/00/00:00'
],
]
|
|
|
Source code |
1 |
print scalar(@ARRAY); |
|
|
Source code |
1 |
$ARRAY[0] |
|
|
Source code |
1 |
ARRAY(0xbe9e80) |