Hi Folks!!!

I have a polling script that polls SNMP counters and keeps adding on the values. The SNMP counter is a 32 bit counter. Now sometimes, when it keeps polling, it gives me an output of NaN as below:

As seen below, after a point, it prints the value as NaN. How can I avoid this?

Tue Mar 4 20:37:58 2014 - Rollover Transferred Till now : 127 +60590224 bytes Tue Mar 4 20:38:09 2014 - MetInStart = 16348693 Tue Mar 4 20:56:12 2014 - Rollover Transferred Till now : NaN + bytes Tue Mar 4 20:56:22 2014 -* ACStart= 5605524 Tue Mar 4 20:59:36 2014 - Rollover AC Transferred Till now : +17039208827 bytes Tue Mar 4 20:59:46 2014 - MetInStart = 12418066 Tue Mar 4 21:17:56 2014 - Rollover Transferred Till now : NaN + bytes Tue Mar 4 21:18:06 2014 -* ACDecryptStart = 8065104 Tue Mar 4 21:21:19 2014 - Rollover AC Transferred Till now : +21321758057 bytes Tue Mar 4 21:21:29 2014 - MetInStart = 29525422 Tue Mar 4 21:39:39 2014 - Rollover - Transferred Till now : N +aN bytes

In reply to NaN output by spikeinc

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.