When I do that on a select statement, i get the following error messages. Use of uninitialized value in string ne at intstatDB.pl line 452. Use of uninitialized value in concatenation (.) or string at intstatDB.pl line 456.

if($rate_total == $crit){ #Add in flap detection, also, if an interface is down +check x4 #before alarming. $stat = "DOWN"; append_log ("CRITICAL: Interface $int_table{$key} is D +OWN.\n"); append_status("CRITICAL: Interface $int_table{$key} is + DOWN.\n"); my $sth = $dbh->prepare("SELECT interface_status FROM +device_iface_cache WHERE interface_name=? and hostname=?"); $sth->execute($int_table{key}, $host); #my $current_status = $dbh->prepare("SELECT interface_ +status FROM device_iface_cache WHERE interface_name='$int_table{$key} +' and hostname='$host';"); #$current_status->execute; my ($f5_iface_status); $f5_iface_status=$sth->fetchrow_hashref(); #print "$f5_iface_status->{interface_status}\n"; if($f5_iface_status->{interface_status} ne $stat) { #my $iface_result = $dbh->prepare("UPDATE device_i +face_cache SET interface_status='$stat', lastcheck='$date', hostname= +'$host' WHERE hostname='$host' AND interface_name='$int_table{$key}'; +"); #$iface_result->execute(); my $iface_result = $dbh->prepare("UPDATE device_if +ace_cache SET interface_status=?, lastcheck=? WHERE hostname=? AND in +terface_name=?"); $iface_result->execute($stat, $date, $host, $int_t +able{$key}); append_log ("STATUS CHANGED: Interface $int_table{ +$key} Was: $f5_iface_status->{interface_status} ------- Now: $stat\n" +); } my $result = $dbh->prepare("UPDATE device_iface_cache +SET interface_status=?, lastcheck=? WHERE hostname=? AND interface_na +me=?"); $result->execute($stat, $date, $host, $int_table{$key} +); }

I've used placeholders before as test, and worked fine. Do you know what's going on here.


In reply to Re^2: Interface flap detection in Perl by sunnyfedora99
in thread Interface flap detection in Perl by sunnyfedora99

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.