]> pere.pagekite.me Git - homepage.git/blobdiff - blog/archive/2009/02/02.rss
Generated.
[homepage.git] / blog / archive / 2009 / 02 / 02.rss
index d1cf37ab1442090de0189ed2c2972961c3e0251a..e9f6f45dd44f108673316873448c4cbb653d4e16 100644 (file)
@@ -3,13 +3,13 @@
        <channel>
                <title>Petter Reinholdtsen - Entries from February 2009</title>
                <description>Entries from February 2009</description>
        <channel>
                <title>Petter Reinholdtsen - Entries from February 2009</title>
                <description>Entries from February 2009</description>
-                <link>../../../</link>
+                <link>http://people.skolelinux.org/pere/blog/</link>
 
        
        <item>
                <title>Intellektuelt privilegium - et bedre IP-begrep</title>
 
        
        <item>
                <title>Intellektuelt privilegium - et bedre IP-begrep</title>
-               <link>../../../Intellektuelt_privilegium___et_bedre_IP_begrep.html</link>        
-               <guid isPermaLink="true">../../../Intellektuelt_privilegium___et_bedre_IP_begrep.html</guid>
+               <link>http://people.skolelinux.org/pere/blog/Intellektuelt_privilegium___et_bedre_IP_begrep.html</link>        
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Intellektuelt_privilegium___et_bedre_IP_begrep.html</guid>
                 <pubDate>Sun, 1 Feb 2009 15:06:00 +0100</pubDate>
                <description>
 &lt;p&gt;Ofte brukes intellektuell eiendom som samlebegrep for opphavsrett,
                 <pubDate>Sun, 1 Feb 2009 15:06:00 +0100</pubDate>
                <description>
 &lt;p&gt;Ofte brukes intellektuell eiendom som samlebegrep for opphavsrett,
@@ -37,8 +37,8 @@ forretningshemmeligheter framover.&lt;/p&gt;
        
        <item>
                <title>Norge trenger en personvernforening</title>
        
        <item>
                <title>Norge trenger en personvernforening</title>
-               <link>../../../Norge_trenger_en_personvernforening.html</link>        
-               <guid isPermaLink="true">../../../Norge_trenger_en_personvernforening.html</guid>
+               <link>http://people.skolelinux.org/pere/blog/Norge_trenger_en_personvernforening.html</link>        
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Norge_trenger_en_personvernforening.html</guid>
                 <pubDate>Sun, 1 Feb 2009 18:35:00 +0100</pubDate>
                <description>
 &lt;p&gt;De siste årene har jeg forsøkt å få liv i
                 <pubDate>Sun, 1 Feb 2009 18:35:00 +0100</pubDate>
                <description>
 &lt;p&gt;De siste årene har jeg forsøkt å få liv i
@@ -59,8 +59,8 @@ nå får vi se om noen er enig.&lt;/p&gt;
        
        <item>
                <title>Min reprap tar sakte form</title>
        
        <item>
                <title>Min reprap tar sakte form</title>
-               <link>../../../Min_reprap_tar_sakte_form.html</link>        
-               <guid isPermaLink="true">../../../Min_reprap_tar_sakte_form.html</guid>
+               <link>http://people.skolelinux.org/pere/blog/Min_reprap_tar_sakte_form.html</link>        
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Min_reprap_tar_sakte_form.html</guid>
                 <pubDate>Tue, 3 Feb 2009 13:30:00 +0100</pubDate>
                <description>
 &lt;p&gt;Min reprap begynner å ta form.  Den er nå kommet så langt at den er
                 <pubDate>Tue, 3 Feb 2009 13:30:00 +0100</pubDate>
                <description>
 &lt;p&gt;Min reprap begynner å ta form.  Den er nå kommet så langt at den er
@@ -99,8 +99,8 @@ arbeidet.&lt;/p&gt;
        
        <item>
                <title>Første vellykkede videostrøm fra NUUG</title>
        
        <item>
                <title>Første vellykkede videostrøm fra NUUG</title>
-               <link>../../../F__rste_vellykkede_videostr__m_fra_NUUG.html</link>        
-               <guid isPermaLink="true">../../../F__rste_vellykkede_videostr__m_fra_NUUG.html</guid>
+               <link>http://people.skolelinux.org/pere/blog/F__rste_vellykkede_videostr__m_fra_NUUG.html</link>        
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/F__rste_vellykkede_videostr__m_fra_NUUG.html</guid>
                 <pubDate>Wed, 11 Feb 2009 06:30:00 +0100</pubDate>
                <description>
 &lt;p&gt;Jeg ble glad for å se under
                 <pubDate>Wed, 11 Feb 2009 06:30:00 +0100</pubDate>
                <description>
 &lt;p&gt;Jeg ble glad for å se under
@@ -118,8 +118,8 @@ webserver og komprimert.&lt;/p&gt;
        
        <item>
                <title>Endelig er Debian Lenny gitt ut</title>
        
        <item>
                <title>Endelig er Debian Lenny gitt ut</title>
-               <link>../../../Endelig_er_Debian_Lenny_gitt_ut.html</link>        
-               <guid isPermaLink="true">../../../Endelig_er_Debian_Lenny_gitt_ut.html</guid>
+               <link>http://people.skolelinux.org/pere/blog/Endelig_er_Debian_Lenny_gitt_ut.html</link>        
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Endelig_er_Debian_Lenny_gitt_ut.html</guid>
                 <pubDate>Sun, 15 Feb 2009 11:50:00 +0100</pubDate>
                <description>
 &lt;p&gt;Endelig er &lt;a href=&quot;http://www.debian.org/&quot;&gt;Debian&lt;/a&gt;
                 <pubDate>Sun, 15 Feb 2009 11:50:00 +0100</pubDate>
                <description>
 &lt;p&gt;Endelig er &lt;a href=&quot;http://www.debian.org/&quot;&gt;Debian&lt;/a&gt;
@@ -139,8 +139,8 @@ bootsekvens tilgjengelig i stabil utgave, vha pakken
        
        <item>
                <title>Kart over overvåkningskamera i Norge</title>
        
        <item>
                <title>Kart over overvåkningskamera i Norge</title>
-               <link>../../../Kart_over_overv__kningskamera_i_Norge.html</link>        
-               <guid isPermaLink="true">../../../Kart_over_overv__kningskamera_i_Norge.html</guid>
+               <link>http://people.skolelinux.org/pere/blog/Kart_over_overv__kningskamera_i_Norge.html</link>        
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Kart_over_overv__kningskamera_i_Norge.html</guid>
                 <pubDate>Sun, 15 Feb 2009 22:30:00 +0100</pubDate>
                <description>
 &lt;p&gt;I regi av
                 <pubDate>Sun, 15 Feb 2009 22:30:00 +0100</pubDate>
                <description>
 &lt;p&gt;I regi av
@@ -159,16 +159,16 @@ fikser en av disse manglene, men det vil fortsatt være umulig å vite
 om et kamera er registrert etter lovens krav eller ikke.  Pr. nå er
 22 kamera i Oslo registrert, og det trengs flere til å registrere
 alle.  Informasjonen registreres direkte inn i &lt;a
 om et kamera er registrert etter lovens krav eller ikke.  Pr. nå er
 22 kamera i Oslo registrert, og det trengs flere til å registrere
 alle.  Informasjonen registreres direkte inn i &lt;a
-href=&quot;http://www.openstreetmap.org/&quot;&gt;OpenStreetmap&lt;/a&gt;, sa hentes det
+href=&quot;http://www.openstreetmap.org/&quot;&gt;OpenStreetmap&lt;/a&gt;, så hentes det
 automatisk over i spesialkartet.&lt;/p&gt;
 </description>
        </item>
        
        <item>
                <title>Using bar codes at a computing center</title>
 automatisk over i spesialkartet.&lt;/p&gt;
 </description>
        </item>
        
        <item>
                <title>Using bar codes at a computing center</title>
-               <link>../../../Using_bar_codes_at_a_computing_center.html</link>        
-               <guid isPermaLink="true">../../../Using_bar_codes_at_a_computing_center.html</guid>
-                <pubDate>Fri, 20 Feb 2009 08:30:00 +0100</pubDate>
+               <link>http://people.skolelinux.org/pere/blog/Using_bar_codes_at_a_computing_center.html</link>        
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Using_bar_codes_at_a_computing_center.html</guid>
+                <pubDate>Fri, 20 Feb 2009 08:50:00 +0100</pubDate>
                <description>
 &lt;p&gt;At work with the University of Oslo, we have several hundred computers
 in our computing center.  This give us a challenge in tracking the
                <description>
 &lt;p&gt;At work with the University of Oslo, we have several hundred computers
 in our computing center.  This give us a challenge in tracking the
@@ -214,5 +214,174 @@ easier automatic tracking of computers.&lt;/p&gt;
 </description>
        </item>
        
 </description>
        </item>
        
+       <item>
+               <title>Checking server hardware support status for Dell, HP and IBM servers</title>
+               <link>http://people.skolelinux.org/pere/blog/Checking_server_hardware_support_status_for_Dell__HP_and_IBM_servers.html</link>        
+               <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Checking_server_hardware_support_status_for_Dell__HP_and_IBM_servers.html</guid>
+                <pubDate>Sat, 28 Feb 2009 23:50:00 +0100</pubDate>
+               <description>
+&lt;p&gt;At work, we have a few hundred Linux servers, and with that amount
+of hardware it is important to keep track of when the hardware support
+contract expire for each server.  We have a machine (and service)
+register, which until recently did not contain much useful besides the
+machine room location and contact information for the system owner for
+each machine.  To make it easier for us to track support contract
+status, I&#39;ve recently spent time on extending the machine register to
+include information about when the support contract expire, and to tag
+machines with expired contracts to make it easy to get a list of such
+machines.  I extended a perl script already being used to import
+information about machines into the register, to also do some screen
+scraping off the sites of Dell, HP and IBM (our majority of machines
+are from these vendors), and automatically check the support status
+for the relevant machines.  This make the support status information
+easily available and I hope it will make it easier for the computer
+owner to know when to get new hardware or renew the support contract.
+The result of this work documented that 27% of the machines in the
+registry is without a support contract, and made it very easy to find
+them.  27% might seem like a lot, but I see it more as the case of us
+using machines a bit longer than the 3 years a normal support contract
+last, to have test machines and a platform for less important
+services.  After all, the machines without a contract are working fine
+at the moment and the lack of contract is only a problem if any of
+them break down.  When that happen, we can either fix it using spare
+parts from other machines or move the service to another old
+machine.&lt;/p&gt;
+
+&lt;p&gt;I believe the code for screen scraping the Dell site was originally
+written by Trond Hasle Amundsen, and later adjusted by me and Morten
+Werner Forsbring.  The HP scraping was written by me after reading a
+nice article in ;login: about how to use WWW::Mechanize, and the IBM
+scraping was written by me based on the Dell code.  I know the HTML
+parsing could be done using nice libraries, but did not want to
+introduce more dependencies.  This is the current incarnation:&lt;/p&gt;
+
+&lt;pre&gt;
+use LWP::Simple;
+use POSIX;
+use WWW::Mechanize;
+use Date::Parse;
+[...]
+sub get_support_info {
+    my ($machine, $model, $serial, $productnumber) = @_;
+    my $str;
+
+    if ( $model =~ m/^Dell / ) {
+        # fetch website from Dell support
+        my $url = &quot;http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/no/details?c=no&amp;amp;cs=nodhs1&amp;amp;l=no&amp;amp;s=dhs&amp;amp;ServiceTag=$serial&quot;;
+        my $webpage = get($url);
+        return undef unless ($webpage);
+
+        my $daysleft = -1;
+        my @lines = split(/\n/, $webpage);
+        foreach my $line (@lines) {
+            next unless ($line =~ m/Beskrivelse/);
+            $line =~ s/&amp;lt;[^&gt;]+?&gt;/;/gm;
+            $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 ($lastend lt $today);
+        }
+    } elsif ( $model =~ m/^HP / ) {
+        my $mech = WWW::Mechanize-&gt;new();
+        my $url =
+            &#39;http://www1.itrc.hp.com/service/ewarranty/warrantyInput.do&#39;;
+        $mech-&gt;get($url);
+        my $fields = {
+            &#39;BODServiceID&#39; =&gt; &#39;NA&#39;,
+            &#39;RegisteredPurchaseDate&#39; =&gt; &#39;&#39;,
+            &#39;country&#39; =&gt; &#39;NO&#39;,
+            &#39;productNumber&#39; =&gt; $productnumber,
+            &#39;serialNumber1&#39; =&gt; $serial,
+        };
+        $mech-&gt;submit_form( form_number =&gt; 2,
+                            fields      =&gt; $fields );
+        # Next step is screen scraping
+        my $content = $mech-&gt;content();
+
+        $content =~ s/&amp;lt;[^&gt;]+?&gt;/;/gm;
+        $content =~ s/\s+/ /gm;
+        $content =~ s/;\s*;/;;/gm;
+        $content =~ s/;[\s;]+/;/gm;
+
+        my $today = POSIX::strftime(&quot;%Y-%m-%d&quot;, localtime(time));
+
+        while ($content =~ m/;Warranty Type;/) {
+            my ($type, $status, $startstr, $stopstr) = $content =~
+                m/;Warranty Type;([^;]+);.+?;Status;(\w+);Start Date;([^;]+);End Date;([^;]+);/;
+            $content =~ s/^.+?;Warranty Type;//;
+            my $start = POSIX::strftime(&quot;%Y-%m-%d&quot;,
+                                        localtime(str2time($startstr)));
+            my $end = POSIX::strftime(&quot;%Y-%m-%d&quot;,
+                                      localtime(str2time($stopstr)));
+
+            $str .= &quot;$type ($status) $start -&gt; $end &quot;;
+
+            tag_machine_unsupported($machine)
+                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 =
+                get(&quot;http://www-947.ibm.com/systems/support/supportsite.wss/warranty?action=warranty&amp;amp;brandind=5000008&amp;amp;Submit=Submit&amp;amp;type=$producttype&amp;amp;serial=$serial&quot;);
+            if ($content) {
+                $content =~ s/&amp;lt;[^&gt;]+?&gt;/;/gm;
+                $content =~ s/\s+/ /gm;
+                $content =~ s/;\s*;/;;/gm;
+                $content =~ s/;[\s;]+/;/gm;
+
+                $content =~ s/^.+?;Warranty status;//;
+                my ($status, $end) = $content =~ m/;Warranty status;([^;]+)\s*;Expiration date;(\S+) ;/;
+
+                $str .= &quot;($status) -&gt; $end &quot;;
+
+                my $today = POSIX::strftime(&quot;%Y-%m-%d&quot;, localtime(time));
+                tag_machine_unsupported($machine)
+                    if ($end lt $today);
+            }
+        }
+    }
+    return $str;
+}
+&lt;/pre&gt;
+
+&lt;p&gt;Here are some examples on how to use the function, using fake
+serial numbers.  The information passed in as arguments are fetched
+from dmidecode.&lt;/p&gt;
+
+&lt;pre&gt;
+print get_support_info(&quot;hp.host&quot;, &quot;HP ProLiant BL460c G1&quot;, &quot;1234567890&quot;
+                       &quot;447707-B21&quot;);
+print get_support_info(&quot;dell.host&quot;, &quot;Dell Inc. PowerEdge 2950&quot;, &quot;1234567&quot;);
+print get_support_info(&quot;ibm.host&quot;, &quot;IBM eserver xSeries 345 -[867061X]-&quot;,
+                       &quot;1234567&quot;);
+&lt;/pre&gt;
+
+&lt;p&gt;I would recommend this approach for tracking support contracts for
+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>
+       
         </channel>
 </rss>
         </channel>
 </rss>