]> pere.pagekite.me Git - homepage.git/commitdiff
Regenerert.
authorPetter Reinholdtsen <pere@hungry.com>
Fri, 6 Mar 2009 15:14:54 +0000 (15:14 +0000)
committerPetter Reinholdtsen <pere@hungry.com>
Fri, 6 Mar 2009 15:14:54 +0000 (15:14 +0000)
blog/Checking_server_hardware_support_status_for_Dell__HP_and_IBM_servers.html
blog/archive/2009/02/02.rss
blog/archive/2009/02/index.html
blog/index.html
blog/index.rss
blog/tags/english/english.rss
blog/tags/english/index.html
blog/tags/nuug/index.html
blog/tags/nuug/nuug.rss

index f3186f2eb49f62f4d93f76a48ce8c1b2f72f2132..08982224344819d637eb389997373f86e04ce9fc 100644 (file)
@@ -76,13 +76,25 @@ sub get_support_info {
         foreach my $line (@lines) {
             next unless ($line =~ m/Beskrivelse/);
             $line =~ s/&lt;[^>]+?>/;/gm;
-            $line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
-            my $start = "$3-$1-$2";
-            my $end = "$6-$4-$5";
-            $str = "$start -> $end";
+            $line =~ s/^.+?;(Beskrivelse;)/$1/;
+
+            my @f = split(/\;/, $line);
+            @f = @f[13 .. $#f];
+            my $lastend = "";
+            while ($f[3] eq "DELL") {
+                my ($type, $startstr, $endstr, $days) = @f[0, 5, 7, 10];
+
+                my $start = POSIX::strftime("%Y-%m-%d",
+                                            localtime(str2time($startstr)));
+                my $end = POSIX::strftime("%Y-%m-%d",
+                                          localtime(str2time($endstr)));
+                $str .= "$type $start -> $end ";
+                @f = @f[14 .. $#f];
+                $lastend = $end if ($end gt $lastend);
+            }
             my $today = POSIX::strftime("%Y-%m-%d", localtime(time));
             tag_machine_unsupported($machine)
-                if ($end lt $today);
+                if ($lastend lt $today);
         }
     } elsif ( $model =~ m/^HP / ) {
         my $mech = WWW::Mechanize->new();
@@ -123,6 +135,7 @@ sub get_support_info {
                 if ($end lt $today);
         }
     } elsif ( $model =~ m/^IBM / ) {
+        # This code ignore extended support contracts.
         my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
         if ($producttype &amp;&amp; $serial) {
             my $content =
@@ -161,7 +174,12 @@ print get_support_info("ibm.host", "IBM eserver xSeries 345 -[867061X]-",
 </pre>
 
 <p>I would recommend this approach for tracking support contracts for
-everyone with more than a new computers to administer. :)</p>
+everyone with more than a few computers to administer. :)</p>
+
+<p>Update 2009-03-06: The IBM page do not include extended support
+contracts, so it is useless in that case.  The original Dell code do
+not handle extended support contracts either, but has been updated to
+do so.</p>
 </div>
   
   <div class="tags">Tags: <a href="tags/english">english</a>, <a href="tags/nuug">nuug</a>.</div>
index af03604c6590a2754792445c1188e3ad303bfdbf..e3adfe8562016ae09c7931a67e5e8e20a0b3cc2f 100644 (file)
@@ -276,13 +276,25 @@ sub get_support_info {
         foreach my $line (@lines) {
             next unless ($line =~ m/Beskrivelse/);
             $line =~ s/&amp;lt;[^&gt;]+?&gt;/;/gm;
-            $line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
-            my $start = &quot;$3-$1-$2&quot;;
-            my $end = &quot;$6-$4-$5&quot;;
-            $str = &quot;$start -&gt; $end&quot;;
+            $line =~ s/^.+?;(Beskrivelse;)/$1/;
+
+            my @f = split(/\;/, $line);
+            @f = @f[13 .. $#f];
+            my $lastend = &quot;&quot;;
+            while ($f[3] eq &quot;DELL&quot;) {
+                my ($type, $startstr, $endstr, $days) = @f[0, 5, 7, 10];
+
+                my $start = POSIX::strftime(&quot;%Y-%m-%d&quot;,
+                                            localtime(str2time($startstr)));
+                my $end = POSIX::strftime(&quot;%Y-%m-%d&quot;,
+                                          localtime(str2time($endstr)));
+                $str .= &quot;$type $start -&gt; $end &quot;;
+                @f = @f[14 .. $#f];
+                $lastend = $end if ($end gt $lastend);
+            }
             my $today = POSIX::strftime(&quot;%Y-%m-%d&quot;, localtime(time));
             tag_machine_unsupported($machine)
-                if ($end lt $today);
+                if ($lastend lt $today);
         }
     } elsif ( $model =~ m/^HP / ) {
         my $mech = WWW::Mechanize-&gt;new();
@@ -323,6 +335,7 @@ sub get_support_info {
                 if ($end lt $today);
         }
     } elsif ( $model =~ m/^IBM / ) {
+        # This code ignore extended support contracts.
         my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
         if ($producttype &amp;amp;&amp;amp; $serial) {
             my $content =
@@ -361,7 +374,12 @@ print get_support_info(&quot;ibm.host&quot;, &quot;IBM eserver xSeries 345 -[867
 &lt;/pre&gt;
 
 &lt;p&gt;I would recommend this approach for tracking support contracts for
-everyone with more than a new computers to administer. :)&lt;/p&gt;
+everyone with more than a few computers to administer. :)&lt;/p&gt;
+
+&lt;p&gt;Update 2009-03-06: The IBM page do not include extended support
+contracts, so it is useless in that case.  The original Dell code do
+not handle extended support contracts either, but has been updated to
+do so.&lt;/p&gt;
 </description>
        </item>
        
index e44d91f70e768185fbc844ce3f292961205a27a0..5b859381756ce877258d82d5f74c71204c7e05b9 100644 (file)
@@ -385,13 +385,25 @@ sub get_support_info {
         foreach my $line (@lines) {
             next unless ($line =~ m/Beskrivelse/);
             $line =~ s/&lt;[^>]+?>/;/gm;
-            $line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
-            my $start = "$3-$1-$2";
-            my $end = "$6-$4-$5";
-            $str = "$start -> $end";
+            $line =~ s/^.+?;(Beskrivelse;)/$1/;
+
+            my @f = split(/\;/, $line);
+            @f = @f[13 .. $#f];
+            my $lastend = "";
+            while ($f[3] eq "DELL") {
+                my ($type, $startstr, $endstr, $days) = @f[0, 5, 7, 10];
+
+                my $start = POSIX::strftime("%Y-%m-%d",
+                                            localtime(str2time($startstr)));
+                my $end = POSIX::strftime("%Y-%m-%d",
+                                          localtime(str2time($endstr)));
+                $str .= "$type $start -> $end ";
+                @f = @f[14 .. $#f];
+                $lastend = $end if ($end gt $lastend);
+            }
             my $today = POSIX::strftime("%Y-%m-%d", localtime(time));
             tag_machine_unsupported($machine)
-                if ($end lt $today);
+                if ($lastend lt $today);
         }
     } elsif ( $model =~ m/^HP / ) {
         my $mech = WWW::Mechanize->new();
@@ -432,6 +444,7 @@ sub get_support_info {
                 if ($end lt $today);
         }
     } elsif ( $model =~ m/^IBM / ) {
+        # This code ignore extended support contracts.
         my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
         if ($producttype &amp;&amp; $serial) {
             my $content =
@@ -470,7 +483,12 @@ print get_support_info("ibm.host", "IBM eserver xSeries 345 -[867061X]-",
 </pre>
 
 <p>I would recommend this approach for tracking support contracts for
-everyone with more than a new computers to administer. :)</p>
+everyone with more than a few computers to administer. :)</p>
+
+<p>Update 2009-03-06: The IBM page do not include extended support
+contracts, so it is useless in that case.  The original Dell code do
+not handle extended support contracts either, but has been updated to
+do so.</p>
 
  </div>
  <div class="tags">
index cbfd1f8a98f5a427ce513ad34f33add9c7a35053..a23a077b884b5c100554185097c4945cfd0fe9e2 100644 (file)
@@ -122,13 +122,25 @@ sub get_support_info {
         foreach my $line (@lines) {
             next unless ($line =~ m/Beskrivelse/);
             $line =~ s/&lt;[^>]+?>/;/gm;
-            $line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
-            my $start = "$3-$1-$2";
-            my $end = "$6-$4-$5";
-            $str = "$start -> $end";
+            $line =~ s/^.+?;(Beskrivelse;)/$1/;
+
+            my @f = split(/\;/, $line);
+            @f = @f[13 .. $#f];
+            my $lastend = "";
+            while ($f[3] eq "DELL") {
+                my ($type, $startstr, $endstr, $days) = @f[0, 5, 7, 10];
+
+                my $start = POSIX::strftime("%Y-%m-%d",
+                                            localtime(str2time($startstr)));
+                my $end = POSIX::strftime("%Y-%m-%d",
+                                          localtime(str2time($endstr)));
+                $str .= "$type $start -> $end ";
+                @f = @f[14 .. $#f];
+                $lastend = $end if ($end gt $lastend);
+            }
             my $today = POSIX::strftime("%Y-%m-%d", localtime(time));
             tag_machine_unsupported($machine)
-                if ($end lt $today);
+                if ($lastend lt $today);
         }
     } elsif ( $model =~ m/^HP / ) {
         my $mech = WWW::Mechanize->new();
@@ -169,6 +181,7 @@ sub get_support_info {
                 if ($end lt $today);
         }
     } elsif ( $model =~ m/^IBM / ) {
+        # This code ignore extended support contracts.
         my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
         if ($producttype &amp;&amp; $serial) {
             my $content =
@@ -207,7 +220,12 @@ print get_support_info("ibm.host", "IBM eserver xSeries 345 -[867061X]-",
 </pre>
 
 <p>I would recommend this approach for tracking support contracts for
-everyone with more than a new computers to administer. :)</p>
+everyone with more than a few computers to administer. :)</p>
+
+<p>Update 2009-03-06: The IBM page do not include extended support
+contracts, so it is useless in that case.  The original Dell code do
+not handle extended support contracts either, but has been updated to
+do so.</p>
 </div>
   <div class="tags">
    
index b5a68d7120af9fd5346cc17b8fb6288b883a8f80..f3a04b13ec972b6026bf22f791f6d94f9e362ebc 100644 (file)
@@ -105,13 +105,25 @@ sub get_support_info {
         foreach my $line (@lines) {
             next unless ($line =~ m/Beskrivelse/);
             $line =~ s/&amp;lt;[^&gt;]+?&gt;/;/gm;
-            $line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
-            my $start = &quot;$3-$1-$2&quot;;
-            my $end = &quot;$6-$4-$5&quot;;
-            $str = &quot;$start -&gt; $end&quot;;
+            $line =~ s/^.+?;(Beskrivelse;)/$1/;
+
+            my @f = split(/\;/, $line);
+            @f = @f[13 .. $#f];
+            my $lastend = &quot;&quot;;
+            while ($f[3] eq &quot;DELL&quot;) {
+                my ($type, $startstr, $endstr, $days) = @f[0, 5, 7, 10];
+
+                my $start = POSIX::strftime(&quot;%Y-%m-%d&quot;,
+                                            localtime(str2time($startstr)));
+                my $end = POSIX::strftime(&quot;%Y-%m-%d&quot;,
+                                          localtime(str2time($endstr)));
+                $str .= &quot;$type $start -&gt; $end &quot;;
+                @f = @f[14 .. $#f];
+                $lastend = $end if ($end gt $lastend);
+            }
             my $today = POSIX::strftime(&quot;%Y-%m-%d&quot;, localtime(time));
             tag_machine_unsupported($machine)
-                if ($end lt $today);
+                if ($lastend lt $today);
         }
     } elsif ( $model =~ m/^HP / ) {
         my $mech = WWW::Mechanize-&gt;new();
@@ -152,6 +164,7 @@ sub get_support_info {
                 if ($end lt $today);
         }
     } elsif ( $model =~ m/^IBM / ) {
+        # This code ignore extended support contracts.
         my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
         if ($producttype &amp;amp;&amp;amp; $serial) {
             my $content =
@@ -190,7 +203,12 @@ print get_support_info(&quot;ibm.host&quot;, &quot;IBM eserver xSeries 345 -[867
 &lt;/pre&gt;
 
 &lt;p&gt;I would recommend this approach for tracking support contracts for
-everyone with more than a new computers to administer. :)&lt;/p&gt;
+everyone with more than a few computers to administer. :)&lt;/p&gt;
+
+&lt;p&gt;Update 2009-03-06: The IBM page do not include extended support
+contracts, so it is useless in that case.  The original Dell code do
+not handle extended support contracts either, but has been updated to
+do so.&lt;/p&gt;
 </description>
        </item>
        
index 0d39669db5b41df1376af93e2e68156f1fc211b9..79cce7b906f604495c802a99839fd9f6c49c9c17 100644 (file)
@@ -252,13 +252,25 @@ sub get_support_info {
         foreach my $line (@lines) {
             next unless ($line =~ m/Beskrivelse/);
             $line =~ s/&amp;lt;[^&gt;]+?&gt;/;/gm;
-            $line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
-            my $start = &quot;$3-$1-$2&quot;;
-            my $end = &quot;$6-$4-$5&quot;;
-            $str = &quot;$start -&gt; $end&quot;;
+            $line =~ s/^.+?;(Beskrivelse;)/$1/;
+
+            my @f = split(/\;/, $line);
+            @f = @f[13 .. $#f];
+            my $lastend = &quot;&quot;;
+            while ($f[3] eq &quot;DELL&quot;) {
+                my ($type, $startstr, $endstr, $days) = @f[0, 5, 7, 10];
+
+                my $start = POSIX::strftime(&quot;%Y-%m-%d&quot;,
+                                            localtime(str2time($startstr)));
+                my $end = POSIX::strftime(&quot;%Y-%m-%d&quot;,
+                                          localtime(str2time($endstr)));
+                $str .= &quot;$type $start -&gt; $end &quot;;
+                @f = @f[14 .. $#f];
+                $lastend = $end if ($end gt $lastend);
+            }
             my $today = POSIX::strftime(&quot;%Y-%m-%d&quot;, localtime(time));
             tag_machine_unsupported($machine)
-                if ($end lt $today);
+                if ($lastend lt $today);
         }
     } elsif ( $model =~ m/^HP / ) {
         my $mech = WWW::Mechanize-&gt;new();
@@ -299,6 +311,7 @@ sub get_support_info {
                 if ($end lt $today);
         }
     } elsif ( $model =~ m/^IBM / ) {
+        # This code ignore extended support contracts.
         my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
         if ($producttype &amp;amp;&amp;amp; $serial) {
             my $content =
@@ -337,7 +350,12 @@ print get_support_info(&quot;ibm.host&quot;, &quot;IBM eserver xSeries 345 -[867
 &lt;/pre&gt;
 
 &lt;p&gt;I would recommend this approach for tracking support contracts for
-everyone with more than a new computers to administer. :)&lt;/p&gt;
+everyone with more than a few computers to administer. :)&lt;/p&gt;
+
+&lt;p&gt;Update 2009-03-06: The IBM page do not include extended support
+contracts, so it is useless in that case.  The original Dell code do
+not handle extended support contracts either, but has been updated to
+do so.&lt;/p&gt;
 </description>
        </item>
        
index 0c0aac3725b74af1ecd3d9e57ec4019945adbecf..f70784cc2f32118ed1636bf9a37b13318ecdd037 100644 (file)
@@ -336,13 +336,25 @@ sub get_support_info {
         foreach my $line (@lines) {
             next unless ($line =~ m/Beskrivelse/);
             $line =~ s/&lt;[^>]+?>/;/gm;
-            $line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
-            my $start = "$3-$1-$2";
-            my $end = "$6-$4-$5";
-            $str = "$start -> $end";
+            $line =~ s/^.+?;(Beskrivelse;)/$1/;
+
+            my @f = split(/\;/, $line);
+            @f = @f[13 .. $#f];
+            my $lastend = "";
+            while ($f[3] eq "DELL") {
+                my ($type, $startstr, $endstr, $days) = @f[0, 5, 7, 10];
+
+                my $start = POSIX::strftime("%Y-%m-%d",
+                                            localtime(str2time($startstr)));
+                my $end = POSIX::strftime("%Y-%m-%d",
+                                          localtime(str2time($endstr)));
+                $str .= "$type $start -> $end ";
+                @f = @f[14 .. $#f];
+                $lastend = $end if ($end gt $lastend);
+            }
             my $today = POSIX::strftime("%Y-%m-%d", localtime(time));
             tag_machine_unsupported($machine)
-                if ($end lt $today);
+                if ($lastend lt $today);
         }
     } elsif ( $model =~ m/^HP / ) {
         my $mech = WWW::Mechanize->new();
@@ -383,6 +395,7 @@ sub get_support_info {
                 if ($end lt $today);
         }
     } elsif ( $model =~ m/^IBM / ) {
+        # This code ignore extended support contracts.
         my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
         if ($producttype &amp;&amp; $serial) {
             my $content =
@@ -421,7 +434,12 @@ print get_support_info("ibm.host", "IBM eserver xSeries 345 -[867061X]-",
 </pre>
 
 <p>I would recommend this approach for tracking support contracts for
-everyone with more than a new computers to administer. :)</p>
+everyone with more than a few computers to administer. :)</p>
+
+<p>Update 2009-03-06: The IBM page do not include extended support
+contracts, so it is useless in that case.  The original Dell code do
+not handle extended support contracts either, but has been updated to
+do so.</p>
 
  </div>
  <div class="tags">
index ea8036c30e2f74e41582c2a6e49a2d5c07e9d446..cb2404833555c891bc90f0ca62fc0ac06ceba322 100644 (file)
@@ -1067,13 +1067,25 @@ sub get_support_info {
         foreach my $line (@lines) {
             next unless ($line =~ m/Beskrivelse/);
             $line =~ s/&lt;[^>]+?>/;/gm;
-            $line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
-            my $start = "$3-$1-$2";
-            my $end = "$6-$4-$5";
-            $str = "$start -> $end";
+            $line =~ s/^.+?;(Beskrivelse;)/$1/;
+
+            my @f = split(/\;/, $line);
+            @f = @f[13 .. $#f];
+            my $lastend = "";
+            while ($f[3] eq "DELL") {
+                my ($type, $startstr, $endstr, $days) = @f[0, 5, 7, 10];
+
+                my $start = POSIX::strftime("%Y-%m-%d",
+                                            localtime(str2time($startstr)));
+                my $end = POSIX::strftime("%Y-%m-%d",
+                                          localtime(str2time($endstr)));
+                $str .= "$type $start -> $end ";
+                @f = @f[14 .. $#f];
+                $lastend = $end if ($end gt $lastend);
+            }
             my $today = POSIX::strftime("%Y-%m-%d", localtime(time));
             tag_machine_unsupported($machine)
-                if ($end lt $today);
+                if ($lastend lt $today);
         }
     } elsif ( $model =~ m/^HP / ) {
         my $mech = WWW::Mechanize->new();
@@ -1114,6 +1126,7 @@ sub get_support_info {
                 if ($end lt $today);
         }
     } elsif ( $model =~ m/^IBM / ) {
+        # This code ignore extended support contracts.
         my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
         if ($producttype &amp;&amp; $serial) {
             my $content =
@@ -1152,7 +1165,12 @@ print get_support_info("ibm.host", "IBM eserver xSeries 345 -[867061X]-",
 </pre>
 
 <p>I would recommend this approach for tracking support contracts for
-everyone with more than a new computers to administer. :)</p>
+everyone with more than a few computers to administer. :)</p>
+
+<p>Update 2009-03-06: The IBM page do not include extended support
+contracts, so it is useless in that case.  The original Dell code do
+not handle extended support contracts either, but has been updated to
+do so.</p>
 
  </div>
  <div class="tags">
index 76833ab5fc13fea7d4a1380aa66e7901f3411c65..b005958d6a6fb5e075cd0f179f113493fd4e6b39 100644 (file)
@@ -801,13 +801,25 @@ sub get_support_info {
         foreach my $line (@lines) {
             next unless ($line =~ m/Beskrivelse/);
             $line =~ s/&amp;lt;[^&gt;]+?&gt;/;/gm;
-            $line =~ m%;(\d{2})/(\d{2})/(\d{4});+(\d{2})/(\d{2})/(\d{4});%g;
-            my $start = &quot;$3-$1-$2&quot;;
-            my $end = &quot;$6-$4-$5&quot;;
-            $str = &quot;$start -&gt; $end&quot;;
+            $line =~ s/^.+?;(Beskrivelse;)/$1/;
+
+            my @f = split(/\;/, $line);
+            @f = @f[13 .. $#f];
+            my $lastend = &quot;&quot;;
+            while ($f[3] eq &quot;DELL&quot;) {
+                my ($type, $startstr, $endstr, $days) = @f[0, 5, 7, 10];
+
+                my $start = POSIX::strftime(&quot;%Y-%m-%d&quot;,
+                                            localtime(str2time($startstr)));
+                my $end = POSIX::strftime(&quot;%Y-%m-%d&quot;,
+                                          localtime(str2time($endstr)));
+                $str .= &quot;$type $start -&gt; $end &quot;;
+                @f = @f[14 .. $#f];
+                $lastend = $end if ($end gt $lastend);
+            }
             my $today = POSIX::strftime(&quot;%Y-%m-%d&quot;, localtime(time));
             tag_machine_unsupported($machine)
-                if ($end lt $today);
+                if ($lastend lt $today);
         }
     } elsif ( $model =~ m/^HP / ) {
         my $mech = WWW::Mechanize-&gt;new();
@@ -848,6 +860,7 @@ sub get_support_info {
                 if ($end lt $today);
         }
     } elsif ( $model =~ m/^IBM / ) {
+        # This code ignore extended support contracts.
         my ($producttype) = $model =~ m/.*-\[(.{4}).+\]-/;
         if ($producttype &amp;amp;&amp;amp; $serial) {
             my $content =
@@ -886,7 +899,12 @@ print get_support_info(&quot;ibm.host&quot;, &quot;IBM eserver xSeries 345 -[867
 &lt;/pre&gt;
 
 &lt;p&gt;I would recommend this approach for tracking support contracts for
-everyone with more than a new computers to administer. :)&lt;/p&gt;
+everyone with more than a few computers to administer. :)&lt;/p&gt;
+
+&lt;p&gt;Update 2009-03-06: The IBM page do not include extended support
+contracts, so it is useless in that case.  The original Dell code do
+not handle extended support contracts either, but has been updated to
+do so.&lt;/p&gt;
 </description>
        </item>