boodo Posted May 6, 2008 Posted May 6, 2008 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.
ptrex Posted May 7, 2008 Posted May 7, 2008 @boodothis will give you a hint on how to query an SNMP device using WMI code.SMNP WMI coderegardsptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
boodo Posted May 7, 2008 Author Posted May 7, 2008 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
ptrex Posted May 7, 2008 Posted May 7, 2008 @boodo You can't expect just to copy and past some code and this to work as expected. First try to understand what your are asking : - read about SNMP protocol - Read about MIB's If I see the time available I will post some examples in the Example section of the forum. No guarantees though. regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
ptrex Posted May 8, 2008 Posted May 8, 2008 @boodo This is the MIB data object you need for getting the tonerinfo on an HP printer : "1.3.6.1.4.1.11.2.4.3.1.2.0" regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
ptrex Posted May 8, 2008 Posted May 8, 2008 @boodo This is the MIB data object you need for getting the tonerinfo on an HP printer : "1.3.6.1.4.1.11.2.4.3.1.2.0" regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
ptrex Posted May 8, 2008 Posted May 8, 2008 @boodo This is the MIB data object you need for getting the tonerinfo on an HP printer : "1.3.6.1.4.1.11.2.4.3.1.2.0" regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
ptrex Posted May 8, 2008 Posted May 8, 2008 @bodooI hope this can help.SNMP - MIB in au3regardsptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now