Jump to content

boodo

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by boodo

  1. Thanks alot that helps me very well @ptrex I don`t want to use mib files with oid`s iàm more indipendend. But there is a nother problem This function works with any Lexmark Printer but not with any HP ore Kyocero or something else. SNMPGET tells me from the other printers that the name is correct. The Oid is: .iso.3.6.1.2.1.25.3.2.1.3.1 Here is a Probe: .iso.3.6.1.2.1.25.3.2.1.3.1 = "HP Color LaserJet 2840" I converted to hex: 06010201190302010301 But it is shorter then the others so i aded 00 -> 0601020119030201030100 -> All Lexmark Printers are sending a reply but no hp ore others. Now iam searching in the internet the oid is a Octet String so i changed 06 in 04 in the protokoll. Nothing happens at next i delete the 2 00 and changing the lenght to 0B but the same. No Response. Her The code fore some try`s I Hope that someone could this understand Mad World.... #include <string.au3> _SUPPLYNAME ("10.1.32.29") Func _SUPPLYNAME($ip) ConsoleWrite(@CRLF & "| | | Funktion zum Auslesen des Supplynamens aufgerufen ! | | |" & @CRLF) ;$Broadcast = "172.30.7.122" ; Detination Address $Port = 161 ; UDP 161 = SNMP port UDPStartup() $Start = 1 $Socket = UDPOpen($ip, $Port) ConsoleWrite(@CRLF & $Socket[1] & "|" & $Socket[2] & "|" & $Socket[3] & @LF & @LF) $cmd = "0x302B02010004067075626C6963A01E0202014402010002010030123010060C2B06010201190302010301000500" ConsoleWrite($cmd & @LF & @LF) UDPSend($Socket, $cmd) $loop = 1 While 1 ;_StartListener($Socket,$Broadcast) $srcv = UDPRecv($Socket, 2048) If ($srcv <> "") Then ConsoleWrite("Received Response" & @CR) ConsoleWrite($srcv & @CR) ExitLoop EndIf $loop = $loop + 1 If $loop = 1000 Then UDPCloseSocket($Socket) ExitLoop EndIf WEnd EndFunc ;==>_SUPPLYNAME
  2. Hi, have somebody an idea how to do this ? However, a special rule is required for large numbers because one byte (eight bits) can only represent a number from 0-255. For example, the number 2680 in the Rane NM 1 microphoneMute OID '1.3.6.1.4.1.2680.1.2.7.3.2.0' cannot be encoded using a single byte. The rule for large numbers states that only the lower 7 bits in the byte are used for holding the value (0-127). The highest order bit is used as a flag to let the recipient know that this number spans more than one byte. Therefore, any number over 127 must be encoded using more than one byte. According to this rule, the number 2680 must be encoded 0x94 0x78. Since the most significant bit is set in the first byte (0x94), the recipient knows to use the lower 7 bits from each byte (0x14 and 0x78) and decode the two bytes as (0x14 *128) + 0x78 = 2680. I want to convert 641 ???
  3. The Mib is not the Problem The Translation to binary seems to be wrong..... When i Comment the this line: $cmd = "0x302B02010004067075626C6963A01E0202014402010002010030123010_060C2B060104010B0204030102000500" The Sequence seems to be wrong.... The string wich its createt looks: 0x315075626C69633130303631343131313234333132300 When i test the $_ObhectID i became: 0x363134313131323433313230 But it should be: 060C2B060104010B0204030102000500
  4. Give me Your Adress and I Will send you german beer But the time it takes to you it will be warm The script has only one bug. The sequence wich is generated is to short so it doesen`t work. But with the explain of you i`am on the right way.
  5. Thanks allot Ptrex its perfect ! How can I thank you ? Best Regards Boodo
  6. Thanks for Reply, im still have the problen that i don`t understand how to revice information from Enterprise mibs. At this time am using snmpget like this: Run(@ComSpec & " /c snmpget -v1 " & $sections[$i] & ' public ' &".1.3.6.1.2.1.1.1.0", @TempDir,"",6) Then i read it with stdoutread. At last i'am closing the pid, but the problem is that is very havy to the cpu. Another Problem is that the handles will not close until i close the main exe. Now i testet some examples like: $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $objLocator = ObjCreate("wbemscripting.swbemlocator") $objServices = $objLocator.connectServer("", "root/snmp/localhost") $objServices.security_.privileges.AddAsString("SeSecurityPrivilege") $objSet = $objServices.ExecQuery ("SELECT * FROM SNMP_NET_DEVICE_123 WHERE hdwr_idx>1" , "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) for $obj in $objset ConsoleWrite( "do whatever ..." & @LF) Next ;---------------------- SNMP Action ------------------------ $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $objLocator = ObjCreate("wbemscripting.swbemlocator") $objServices = $objLocator.connectServer("", "root/snmp/localhost") $objServices.security_.privileges.AddAsString("SeSecurityPrivilege") $obj= $objServices.Get("SNMP_NET_DEVICE_123=@") $obj.deviceLocation = "40/5073" $obj.put_ _________________________________________________________________________ Or: #include <GUIConstants.au3> $IP = "127.0.0.1" $hwnd = GUICreate ("MIB Data Viewer", 800, 600) $edit1 = GUICtrlCreateEdit ("", 0, 0, 800, 600) GUICtrlSetBkColor (-1, 0x000000) GUICtrlSetColor ($edit1, 0xFFFFFF) UDPStartup() $socket = UDPBind($IP, 161) If @error = 1 Then MsgBox(0, "error", "Incorrect IP") If @error = 2 Then MsgBox(0, "error", "Incorrect port") MsgBox(0, "error", @error) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg () $data = UDPRecv($socket, 256) If $data <> "" Then GUICtrlSetData ($edit1, GUICtrlRead ($edit1) & @CRLF & _ "------------------------------------------------------------------------------------------" & _ @CRLF & $data) EndIf Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func OnAutoItExit() UDPCloseSocket($socket) UDPShutdown() EndFunc But the problem is that nothing works and i don`t know how to get the information that i want like the value of: .1.3.6.1.2.1.1.1.0 I`m searching since 4 weeks an nowbody has an Idea how to to it Thanks @all
  7. Hello, i want to recive information about printers supplies status. At this time i`m using snmpget,but the cpu load is very high Does anyone have an idear how to do it ? Thanks alot.
×
×
  • Create New...