<? $startip = "172.16.0.2"; $endip = "172.16.0.254"; $ntp1 = "172.16.0.1"; $ntp2 = "172.16.0.1"; $gmt = "540"; $interval = "86400"; $community = "private"; $dissummertime = ".1.3.6.1.4.1.171.12.10.12.1.0"; //i $enantp = ".1.3.6.1.4.1.171.12.10.11.1.0"; //i $ntpupdateoid = ".1.3.6.1.4.1.171.12.10.11.5.0"; //i $ntp1oid = ".1.3.6.1.4.1.171.12.10.11.3.0"; //a> $ntp2oid = ".1.3.6.1.4.1.171.12.10.11.4.0"; //a $gmtoid = ".1.3.6.1.4.1.171.12.10.10.4.0"; //i $saveconfig = ""; ?>
<?. // include_once('config.php'); // IP , $ip = ip2long($startip); $ip2 = ip2long($endip); // IP for($ip;$ip <= $ip2; $ip++) { // IP xxx.xxx.xxx.xxx , snmp $ipdec = long2ip($ip); // 80 $fp = @fsockopen ($ipdec, "80", $errno, $errstr, 2); // , : IP - Error - ( ) if (!$fp) { echo $ipdec." - Error - $errstr ($errno)<br />"; // snmp } else { // snmpset($ipdec, $community, $dissummertime, "i", "0"); // ntp snmpset($ipdec, $community, $enantp, "i", "3"); // snmpset($ipdec, $community, $ntpupdateoid, "i", $interval); // ntp snmpset($ipdec, $community, $ntp1oid, "a", $ntp1); // ntp snmpset($ipdec, $community, $ntp2oid, "a", $ntp2); // snmpset($ipdec, $community, $gmtoid, "i", $gmt); // : IP - OKe echo $ipdec." - OKe<br />"; } } ?>
Source: https://habr.com/ru/post/152931/
All Articles