Hey Monks,

I am fairly new to Perl, with not very much programming experience. Well, basically here is my situation. We have two firewalls both running Checkpoint Firewall-1. One is the primary in production and the other is on the network, but acting as a hot standby. Right now, if the primary fails, then we have to reconfigure the secondary manually with the primary's ip's and bring it up. I would like to automate this process. Here is what I would like to automate:

1.) Have the secondary firewall periodically ping the primary to see if it is up. Even better have the secondary firewall ssh (since it is a firewall, I don't want to use telnet) to the primary and test to see if the firewall daemon is running.

2.) If the firewall daemon is not running, then have the secondary run a: ifconfig -a down on the primary and run a script on itself that will bring up its interfaces with the ip's of the primaries and install the latest rulebase.

I know there are some products that will do this and much more, but right now there is no money in our budget for it, so I figured I would try to write a script to do this automatically.

Can this be done in Perl? Can somebody with a little Perl experience, but a lot of determination do it Which modules should I use?

Thanks in advance for any help. If I come up with something that works, I will post it here.

-Dru

Edit 2001-05-30 by mirod: changed the title


In reply to Monitoring a firewall using ssh (was: Is this possible in Perl?) by dru145

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.