Thread Regex matched nicht (24 answers)
Opened by FlorianL at 2008-03-13 15:51

FlorianL
 2008-03-13 15:51
#107001 #107001
User since
2007-05-18
142 Artikel
BenutzerIn
[default_avatar]
Hallo zusammen :)

Irgenwie bekomm ich das matching nicht auf die reihe, dabei ist es sogar ziemlich simpel! :(

Die erste abfrage klappt noch, nummer 2 muss ich noch bearbeiten weil erst noch eine select-box mit angebeben werden muss. Aber die dritte sollte funzen, tut sie aber nich ?! :)

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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/perl
#
# Script zur abfrage auf neue Patches bei IBM
#
# Author: Florian L  - 13.03.08
#
# Usage: ./checkupdate.pl
#
##############################################
use strict;
use warnings;
use LWP::UserAgent;

my $proxy = 'http://***:***@svproxsg01.****.de:8080/';

my $browser = LWP::UserAgent->new;
$browser->timeout(10);
$browser->proxy(['http','ftp'], $proxy) if defined $proxy;
$browser->cookie_jar({});

sub checkhmc() {
        print ("Trying http://www14.software.ibm.com/webapp/set2/sas/f/hmc/home.html\n");
        my $request = HTTP::Request->new('GET',"http://www14.software.ibm.com/webapp/set2/sas/f/hmc/home.html");
        my $response = $browser->request($request);
        if ($response -> is_success()) {
                my @site = $response->content;
                foreach (@site) {
                        my $line = $_;
                        if ($line =~ m/HMC V7 (.+)<\/a>/g) {
                                print("Aktuelle HMC Version: HMC V7 $1\n");
                        }
                }
        } else {
                print  "ERROR ".$response->message;
        }
}

sub checkfixpack() {
        print ("Trying http://www-912.ibm.com/eserver/support/fixes/fixcentral/pfixpacks/53\n");
        my $request = HTTP::Request->new('GET',"http://www-912.ibm.com/eserver/support/fixes/fixcentral/pfixpacks/53");
        my $response = $browser->request($request);
        if ($response -> is_success()) {
                my @site = $response->content;
                foreach (@site) {
                        my $line = $_;
                        if ($line =~ m/pseriesfixpackinformation\/(.+)\"/g) {
                                print("Fixpack: $1\n");
                        }
                }
        } else {
                print  "ERROR ".$response->message;
        }
}

sub checkvios() {
        print ("Trying http://www14.software.ibm.com/webapp/set2/sas/f/vios/download/home.html\n");
        my $request = HTTP::Request->new('GET',"http://www14.software.ibm.com/webapp/set2/sas/f/vios/download/home.html");
        my $response = $browser->request($request);
        if ($response -> is_success()) {
                my @site = $response->content;
                foreach (@site) {
                        my $line = $_;
                        if ($line =~ m/Fix Pack (.+)<\/b>/g) {
                                print("Vios Fixpack: $1\n");
                        } elsif ($line =~ m/IOSLEVEL: (.+)<\/b>/g) {
                                print("IOS-Level: $1\n");
                        }
                }
        } else {
                print  "ERROR ".$response->message;
        }
}

checkhmc();
checkfixpack();
checkvios();


-Florian

View full thread Regex matched nicht