"The Dude"

the web server doesnt seem to work. I changed the port to 888. And now it does seem to crash alot, but I to discovered the network and deleted the map many times, and I am working remotly to my new Dude server

DUDE rocks!

Feature suggestion:

The ability to add windows short cuts to the tools menu that appears when right clicking a device. This could be used to display MRTG graphs, proprietary management interface etc.

Oops, shot from the hip again. This feature is provided under tools. However, I can’t seem to execute anything that involves a long file name, which is most things on a windows box.

Also, probes for SMTP and POP3 servers don’t seem to work. It reports them as down when they are up.

I have dude installed on the pc but cant install on router?
Dont see anywhere how to install on the router so it will run as the server and my pc as the client?
I read the usage notes but didnt see it there.
I know this is very basic but so am I.
thanks
Cindy

looks kool . but how do i get multible networks to work..

i setup 1 dude on a xp pr box on my local net . it main MT router i attached to 2 additional networks . which i can get to thru it for my internal

internal network 192.168.4.0/24

MT networks

212.212.212.0.24
192.168.10.0/24

dude can ping them but will not discover any thing. so does this mean i have to put a additional box on the other side of my main MT box?

Randy

You cannot install anything on a machine running RouterOS. I guess that MT may implement a version included in RouterOS (like the bandwidth tester) in the future.

The network map has to have SNMP discovery. I mean that all my routers have a SNMP community that can by accesed by one host. And via .1.3.6.1.2.1.4 OIDs you can draw a map of all gateways for different networks :wink:

This is the PHP script I’ve made some months ago:

<?
function GetData($arr) {
    $ret = array();
    foreach ($arr as $i) {
        $a = explode(".", $i, 2);
        $b = explode(" = ", $a[1], 2);
        $c = explode(" ", $b[1], 2);
        if (count($c) < 2) { print "DEBUG: var i: $i"; }
        $ret[$b[0]] = $c[1];
    }
    return $ret;
}

function cidr($val) {
    $num = 8;
    for ($i = 0; $i < 8; $i++) {
        $x = (intval($val) >> $i)&1;
        if ($x == 1) {
            return $num;
        }
        $num--;
    }
    return $num;
}
function NetmaskToCIDR($mask) {
    $a = explode(".", $mask, 4);
    return cidr($a[0]) + cidr($a[1]) + cidr($a[2]) + cidr($a[3]);
}

function ArraySearch($arr, $val) {
    $ret = array();
    foreach ($arr as $key => $i){
        if ($i == $val) {
            $ret[$key] = $i;
        } else {
//          print_r("$i != $val for $key\n");
        }
    }
    return $ret;
}

function ArrayIntersect($arr1, $arr2) {
    $ret = array();
    foreach ($arr1 as $key => $i) {
        $ret[$key] = $arr2[$key];
    }
    return $ret;
}

function netmask($val) {
    $ret = 0;
    for ($i = 0; $i <= $val; $i++) {
        $ret <<= 1;
        $ret |= 1;
    }
    $ret <<= 32-$val;
    return $ret;
}
function IPinNet($address, $mask) {
    $i = explode(".", $mask, 4);
    $b = explode(".", $address, 4);
    $b[0] = intval($b[0]) & intval($i[0]);
    $b[1] = intval($b[1]) & intval($i[1]);
    $b[2] = intval($b[2]) & intval($i[2]);
    $b[3] = intval($b[3]) & intval($i[3]);
    return implode(".", $b);
}

function PrintNet($arr) {
    foreach ($arr as $key => $i) {
        print $key."/".$i."\n";
    }
}

function GetInfo($host, $community, $parent = array()) {
    $cmd = '/usr/local/bin/snmpwalk -v1 -c '.$community.' '.$host.' ';
    $ret = array();
    $ret["called_ip"] = $host;
    $ret["address"] = array();
    $ret["ips"] = array();
    $ret["type"] = "router";
    $ret["id"] = "";
    $ret["childs"] = array();
    $ret["peers"] = array();

    $arr = array();
    exec($cmd.'.1.3.6.1.2.1.4.21.1.7',$arr,$val);
    if ($val) { return $ret; }
    $a = GetData($arr);
    $a = array_values(array_unique($a));
    $ret["peers"] = $a;

    $arr = array();
    exec($cmd.'.1.3.6.1.2.1.4.20.1.1',$arr);
    $a = GetData($arr);

    $arr = array();
    exec($cmd.'.1.3.6.1.2.1.4.20.1.3',$arr);
    $b = GetData($arr);

    foreach($a as $key => $val) {
        $ret["address"][] = array(  "ip"        => $val,
                                    "mask"      => $b[$key],
                                    "cidr"      => NetmaskToCIDR($b[$key]),
                                    "net"       => IPinNet($val, $b[$key])
                            );
        $ret["ips"][] = $val;
    }

    $arr = array();
    exec($cmd.'.1.3.6.1.2.1.1.6.0',$arr);
    $a = GetData($arr);
    $ret["type"] = $a[0];

    $arr = array();
    exec($cmd.'.1.3.6.1.2.1.1.5.0',$arr);
    $a = GetData($arr);
    $ret["id"] = $a[0];

    foreach ($ret["peers"] as $ip) {
        if (array_search($ip,$parent) === false &&
            $ip != "0.0.0.0") { $ret["childs"][] = GetInfo($ip, $community, $ret["ips"]); }
    }

    return $ret;
}

function SimpleMap($net, &$cx, &$cy) {
    global $size;
    $ret = array();
    $cx += 13*2;
    $ox = $cx + 97;
    $dx = $ox;
    foreach($net as $host) {
        $ret[] = array( "ip"    => $host["called_ip"],
                        "x"     => $cx,
                        "type"  => $host["type"],
                        "childs"=> SimpleMap($host["childs"], $dx, $cy),
                        "y"     => $cy
                    );
        $cy += $size[$host["type"]]["y"]+13*2;
        $dx = $ox;
    }

    return $ret;
}

function ExtractHosts($net, &$hosts) {
    foreach($net as $host) {
        $hosts[$host["called_ip"]] = array(
                        "called_ip"     => $host["called_ip"],
                        "address"       => $host["address"],
                        "ips"           => $host["ips"],
                        "type"          => $host["type"],
                        "id"            => $host["id"],
                        "peers"         => $host["peers"]
                    );
        foreach ($host["ips"] as $ip) {
            $hosts[$ip] = &$hosts[$host["called_ip"]];
        }
        ExtractHosts($host["childs"], $hosts);
    }
}

$image_router   = imagecreatefrompng("router.png");
$image_nas      = imagecreatefrompng("nas.png");

$size["router"]["x"] = 97;
$size["router"]["y"] = 97;
$size["nas"]["x"] = 97;
$size["nas"]["y"] = 87;

function DrawTree($img, $map, $hosts) {
    global $image_router, $image_nas;


}

$net = GetInfo("host", "community");
print_r($net);
//$cx = 0; $cy = 0;
//$map = SimpleMap(array($net), $cx, $cy);
//$hosts = array();
//ExtractHosts(array($net), $hosts);
//print_r($net);
//print_r($map);
?>

P.S.: I don’t finished the code… This is some working version of it.

It will be nice, if would be able to minimize Dude to tray :slight_smile:

Can I set the winbox port?

snmp would be wonderful :slight_smile:

for devices being “tested” merely by a ping: Maybe it’s there somewhere, but I do not see method of setting some number of retries before DUDE classifies it as a failure.

how do I change the ping frequency. The alert window pops up a message if a device loses 1 ping and then when it comes back on. I’d like to configure this if at all possible?

We will think about such feature.

No, we will not add this, because The Dude is made for RouterOS v2.9. And in v2.9 there is no need to change the Winbox port.

In next version you will be able to modify the ping probe settings: Retry Count and Retry Interval.

In next version this will be fixed. To make these probes to work read note.
:exclamation: Note: When you install the new version you need to remove all the Probes that are in the Probes menu. Then you should click on the Server button and uncheck that checkbox and apply the changes - it will stop the server. Then enable it again by checking the checkbox and clicking OK. After that you will see that the Probes are back again. But you need to discover all the services for all the devices that you have, because all previos services wil lbe displayed as unknown.

Thanks for your replies uldis.

I have a feature suggestion, cascading error reports/alarms. This is where a device can be set as say, a “child” of a another device so that if the parent fails, testing of the child is suspended.

Maybe it’s just in my particular network but this is a really big deal for me. When using paging as the notification method, if the router that connects the NMS PC to the rest of the network, for example, fails I get a message for every device. I just want one to say that that particular router has failed.

'Hope you can include this feature.

This feature is already added in the future feature list.

where to download file for test snmp logging?
10x

Look in this topic for download link:
http://forum.mikrotik.com/viewtopic.php?t=3251