[ CIH @ 06.02.2009. 13:21 ] @
Ljudi da li je nekome ova scripta proradila, ako jeste molimo pomagajte kako ste je naterali da radi i na kojoj verziji Mikrotika. Ja koristim mikrotik 2.9.6 i 2.9.27 ni na jednoj verziji ne radi. probao sam da zamenim i na dva razlicita hosta koja oba imaju podrusku u php za snmp. Na jednom izbacuje: Mikrotik signal list MAC Signal strenght(dBm) a na drugom Warning: snmpwalkoid(): No response from mojaipadresa cart\index.php on line 43 Mikrotik signal list MAC Signal strenght(dBm) Please check SNMP settings and IP address naravno da sam uneo javnu ip adresu Mikrotika podesavanja mikrotika snmp> print enabled: yes contact: "" location: "" snmp community> print # NAME ADDRESS READ-ACCESS 0 public 0.0.0.0/0 yes Pomozite ako mozete, unapred zahvalan. kod: Code: <!-- /******************************************************************* * Mikrotik SNMP signal reader by Perica Nikolic * Contact [email protected] * This copyright notice MUST stay intact for use. * * This is free software; you can redistribute it and/or modify. * This script is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. ********************************************************************/ --> <?php // Date in the past header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // always modified header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // HTTP/1.1 header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); // HTTP/1.0 header("Pragma: no-cache"); ?> <html> <head> <META HTTP-EQUIV="REFRESH" CONTENT="10"> <link href="stil.css" type="text/css" rel="stylesheet" /> </head> <body> <table align="center"> <caption class="maintable">Mikrotik signal list</caption> <th class="maintable">MAC</th> <th class="maintable">Signal <br>strenght(dBm)</th> <?php $ip="hostname or IP"; //Change IP to your host names, address $mask_mac=false; //Use to mask MAC adress (true / false ); $tx_bytes_snmp = snmpwalkoid("$ip", "public", ".1.3.6.1.4.1.14988.1.1.1.2.1.3"); if (is_array($tx_bytes_snmp)) while (list($indexOID,$rssi)= each($tx_bytes_snmp)) { $oidarray=explode(".",$indexOID); $end_num=count($oidarray); $mac=""; for ($counter=2;$counter<8;$counter++) { $temp=dechex($oidarray[$end_num-$counter]); if ($oidarray[$end_num-$counter]<16) $temp="0".$temp; if (($counter <5) and $mask_mac) $mac=":"."xx".$mac; else if ($counter==7) $mac=$temp.$mac; else $mac=":".$temp.$mac; } $mac_oiu = substr(str_replace(":","-",$mac),0,8); $mac=strtoupper($mac); ?> <tr><td class="maincolum"><a href="http://standards.ieee.org/cgi-bin/ouisearch?<?php echo ($mac_oiu); ?>" target="_blank" class="tablelink"><?php echo ($mac); ?></a></td> <td class="maincolum" align="center"><?php echo ($rssi); ?></td> </tr> <?php } else { ?> <tr><td colspan="2" class="warning">Please check SNMP settings and IP address</td></tr> <?php } ?> </table> </body> </html> |