Okay, I've updated the code in my original post to reflect what I currently have, and now when I run the script I get the output in /dev/tty9, which is what I'm going for. However... I still have two problems.

1.) When I run the script from crontab, the script does not run. It shows the following output in /var/log/syslog:
Dec 27 11:59:01 penguin /USR/SBIN/CRON[5333]: (root) CMD (root^I/home/ +jason/Desktop/monitor_script/nms/nms.pl) Dec 27 11:59:01 penguin /USR/SBIN/CRON[5327]: (root) MAIL (mailed 25 b +ytes of output but got status 0x0001 ) Dec 27 11:59:01 penguin /USR/SBIN/CRON[5326]: (root) MAIL (mailed 24 b +ytes of output but got status 0x0001 ) j
** I just figured out a solution, I told it to sleep for 30 seconds, then execute itself again. Does anybody see any problems with this?

2.) Each time the script is ran manually, the screen is cleared with initscr() function from ncurses. Does anybody know how to not have the screen clear? I want it to look as if the screen updates, rather than have it clear and have the systems reappear after they have a successful or failed ping.

Any help is greatly appreciated. Thanks.

In reply to Re: output script to /dev/tty9 by jbush82
in thread output script to /dev/tty9 by jbush82

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.