<html>

<head>
<title>
Frequently Asked Questions About <em>mon</em>
</title>
</head>

<body bgcolor="#d5d5d5">

<h1> Frequently Asked Questions About <em>mon</em> </h1>

<ol>
<ol>
    <li>
    <h2> Does "mon" require SATAN to run? </h2>
        No, it does not. SATAN includes the "fping" and
        "tcp_scan" utilities, which the fping, tcp, and telnet
        monitors used to use. The dependencies on these
        SATAN modules have since been removed. fping is available
	as a separate package from mon, and can be found on
	kernel.org.
    <p>

    <li>
    <h2> Where can I get everything that I need for "mon"? </h2>
        <ul>
            <li> Perl and Perl modules are available from your nearest
        <a href="http://www.perl.com/CPAN/">CPAN archive</a>. 
        <li> "fping" is available from
            <a href="ftp://ftp.kernel.org/pub/software/admin/mon/fping-2.2b1.tar.gz">
                kernel.org</a>.
        <li> The Net-SNMP (formerly UCD-SNMP) library is available from
            <a href="http://net-snmp.sourceforge.net/">
             http://net-snmp.sourceforge.net/
            </a>.
        </ul>
    <p>

    <li>
    <h2> When I compile fping-2.2b1 under Linux, I get these
    	errors:</h2>
<pre>
fping.c:216: conflicting types for sys_errlist
/usr/include/stdio.h:221: previous declaration of sys_errlist
make: *** [fping.o] Error 1
</pre>

    Comment out line 221 in fping.c, since it's a re-declaration
    of an extern in stdio.h.
    <p>

    <li>
	<h2> When I run "mon" on Solaris, the daemon appears to start, but
		clients hang. </h2>
    Chances are mon hasn't started at all, and the clients are connecting
    to something running on the old mon port of 32777. Check /usr/adm/messages
    for a message from mon which says "Could not bind TCP server port".
    <p>

    "mon" has been assigned a port of 2583 by the IANA. If you're running
    an older version of mon (0.37), then you should change the default
    port from 32777 to 2583 by editing the code in the server (change
    "$SERVPORT  = 32777" to "$SERVPORT  = 2583") and the clients.
    <p>

    <li>
    <h2> How do I get satan-1.1.1 to work under Linux? </h2>
    You need to apply the patches available from
    <a href="ftp://sunsite.unc.edu/pub/Linux/system/network/admin">
    ftp://sunsite.unc.edu/pub/Linux/system/network/admin
    </a>
    in order for satan to build and work properly. This is really
    worth doing, because <em>fping</em> is a huge win when you have
    a group that contains a large number of hosts.
    <p>

    <li>
    <h2> Where can I get QuickPage? </h2>
    QuickPage is freely available from
    <a href="http://www.qpage.org/">
    www.qpage.org
    </a>.
    <p>


    <li>
    <h2> Is there a monitor for (insert service here)? </h2>
    Quite possibly. Check the
    <a href="http://acsys.anu.edu.au/~tpot/hypermail/mon/">
    mailing list archives</a>, or the
    <a href="ftp://ftp.kernel.org/pub/software/admin/mon/contrib/">contrib</a>
    area.
    <p>

    <li>
    <h2> Is mon Y2K compliant? How about Time::Period? </h2>
    All times are stored as time(2) values, which causes no problems with
    year 2000. All time calculations are done using these values (it would
    be much trouble to do them otherwise).
    <p>

    Time::Period uses the same mechanism.
    <p>

    For more information, see
    <a href="http://language.perl.com/news/y2k.html"> Year 2000
    Compliance: Lawyers, Liars, and Perl </a>
    <p>



    <li>
    <h2> When I run mon on RedHat 5.x, I get lots of syntax errors. </h2>

    The *.ph files generated by h2ph under RedHat 5.x (for Intel, at least) are
    broken. They have been fixed by Alan Robertson
    (<a href="mailto:alanr@bell-labs.com">alanr@bell-labs.com</a>), and are
    included in his RPM of mon. This RPM is available from the main
    distribution site on
    <a href="ftp://ftp.kernel.org/pub/software/admin/mon/">ftp.kernel.org.</a>

    <p>


    <li>
    <h2>When I run 'mon' on Linux/Redhat 5.0 it complains about "setlogsock"
    </h2>

    Redhat 5.0 comes with perl-5.004-1. The 'setlogsock' system call
    was added in perl-5.004-3. To solve this get perl-5.004-6.i386.rpm 
    from the Redhat 5.1 distribution and upgrade with the command 
    "rpm -Uh perl-5.004-6.i386.rpm".

    <p>


    <li>
    <h2> How do I send an alert only after a service has been down
     for more than <em>n</em> minutes? </h2>

    The "alertafter" parameter in a period definition can do (something
    like) this.  For example:

    <pre>
    watch newkernel
	    service telnet
		interval 8m
		monitor telnet.monitor
		period wd {Sun-Sat}
		    alert mail.alert mis
		    alertafter 3 30m
		    alertevery 2h
    </pre>

    This effectively means, "alert after 3 or more failures that happen
    within 30 minutes."
    <p>

    In the case of pinging a host, here's a neat hack:
    <pre>
    watch hostgroup
	    service fping
		interval 6m
		monitor fping.monitor -r 4 -t 60000
		period wd {Sun-Sat}
		    alert mail.alert mis
		    alertevery 1h
    </pre>

    This makes fping return a failure for a host that doesn't
    answer in 4 pings, with 60 seconds between each ping.
    <p>


    <li>
    <h2> Can I include hostgroups inside of hostgroups? </h2>
    <pre>
    On Mon, 12 Jan 1998, Thomas Mike Michlmayr (mike@cosy.sbg.ac.at) wrote:

    &gt hi!
    &gt
    &gt i'm trying to setup mon here at our department, and one of the features i'm
    &gt either missing or overlooking is the possibility to include hostgroups in
    &gt a hostgroup.
    &gt 
    &gt is this deliberatly, or just something noone thought of?

    </pre>

    This is deliberate. I've thought about it a good bit and I decided to
    not implement it in the mon config parser because it didn't make too
    much sense to me. The only function that sub-hostgroups would serve is
    essentially for clarity in the configuration file.
    <p>

    To do what you want, it would be trivial to make an m4-based
    configuration, in which you define your hostgroups like this:
    <p>

    <pre>
    define(`HOSTGROUP1',`host1 host2 host3')dnl
    define(`HOSTGROUP2',`host4 host5 host6')dnl
    hostgroup real_hostgroup HOSTGROUP1 HOSTGROUP2
    </pre>

    and just do <code>"m4 mon.cf.m4 &gt mon.cf"</code> and you will end up
    with this:
    <p>
    <pre>
    hostgroup real_hostgroup host1 host2 host3 host4 host5 host6
    </pre>
    <p>
</ol>

<a href="mailto:trockij@linux.kernel.org"> trockij@linux.kernel.org </a>
</body>

</html>
