Welcome to Pandora FMS Community!

Find answers, ask questions, and connect with our community around the world.

Welcome to Pandora FMS Community Forums Community support Two new Pandora user modules

  • Two new Pandora user modules

    Posted by raul on October 15, 2006 at 03:01

    You can find them at http://pandora.sourceforge.net/en/index.php?sec=../examples/user_modules

    # Check for WEB Page content change

    # This user module checks contents of a web page and makes a MD5 of all
    static data
    # its compared with a proposed value (to get this value simply exec the
    MYMD5 command). If changes, module fails.

    MYMD5=`echo -e “GET / HTTP/1.0nnn” | nc -w 30 pandora.sourceforge.net 80 |
    grep -v “Date:” | md5sum | awk ‘{ print $1 }’`
    VALIDMD5=e85c0b9018a22c1086c8e0179cd224b1
    if [ “$MYMD5” != “$VALIDMD5” ]
    then
    MD5SUM=0
    else
    MD5SUM=1
    fi
    echo “
    echo “pandora.sourceforge.net_WEBContenct
    echo “generic_proc
    echo “$MD5SUM
    echo “

    # MODULE END ========================

    # Check for DNS Entry change

    # This user module try to compare public IP with your local IP.
    # Makes a traceroute, and if needs to get out of your LAN it’s because
    your public IP is not the same that
    # are published in internet’s DNS. You need to adjust MAXHOPS. In a LAN
    without firewalls (only your dsl router), 1 hop is needed.

    HOSTNAME=pandora.sourceforge.net
    MAXHOPS=1
    MAXHOPS2=`expr $MAXHOPS + 1`
    SALIDA=`traceroute -n $HOSTNAME -w 5 -m $MAXHOPS2 2> /dev/null |
    awk ‘{print $1 }’ | tail -1`
    # if SALIDA != MAXHOPS, error (more than MAXHOPS hop, if this is our
    local IP, no more than MAXHOPS hop its needed
    if [ “$SALIDA” == “$MAXHOPS” ]
    then
    DNS_STATUS=1
    else
    DNS_STATUS=0
    fi
    echo “
    echo “DNS_CHECK
    echo “generic_proc
    echo “$DNS_STATUS
    echo “

    # MODULE END ========================

    raul replied 17 years, 11 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.