Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Because most people don't think about usability. (Though I'll note that your example code doesn't show any error handling)
    • Here's a little from the bits I omitted,
          unless ( Net::Ping->new->ping($host,1) ) {
              warn "Couldn't ping $host\n";
              next;
          }
       
          my $s = SNMP::Simple->new(
              DestHost  => $host,
              Community => 'public',
              Version   => 1,
              );
          warn "No session for $host" && next unless $s;
       
          $data{name}     = $s->get('sysName');
          ...
      The data is passed to a template anyway, which reflects the "oh well" error-handling disposition. I could always certainly add $data{name} = $s->get('sysName') || 'unknown';
      --
      qw(Ian Langworth)