Jump to content

Computer Plucker - remote PC inventory


t0nZ
 Share

Recommended Posts

Computer Plucker is a fork and a "restoration" of Computer stats utility by @Rogue5099 (link)
You can obtain various data about local machine, as from the screenshot.

cpuU.PNG.9651dc6427784f3fc1052b361a62c788.PNG

But my goal is not (only) to provide another PC stats tool, but to develop a very basic remote inventory tool, like (a small subset of) the abandoned Spiceworks or the Microsoft SCCM.

So this script can be deployed on a machine as a standalone executable (yes you need only ONE file to distribute) , and launching the .EXE it installs itself to a folder (es. c:\autoit\computerplucker)

In tools menù you can set two tasks and not only

  • one for creating every week a file.ini with all the data of the machine.
  • another one  for creating every week a file.ini with all the data of the machine PLUS uploading a CRYPTED record of the machine in a free mysql DB online

For my needs, I am  deploying the .exe and schedule the second task, uploading data one time a week.

In tools menù you will find also commands for:

  • manual creating the .ini data file
  •  to upload the data in crypted records
  • to upload the data in clear text records (for testing..)
  • total uninstall of ComputerPlucker, with a simple security code.
  • many other tasks in not so logical order.. next version I have to tidy the menù...

So my plan is to deploy this on my machines, and have the data in a online DB, this DB will be for me only a "cache" for data records to be downloaded (and deleted) by another script.

As today the account of this TEST DB is embedded in code, using the "File to Base64 String' Code Generator" by @UEZ (used also for embedding icons and XML task definitions)

    Local $mysqlhost = "sql11.freemysqlhosting.net"
    Local $mysqlport = "3306"
    Local $mysqldb = "sql11403701"
    Local $mysqluser = "sql11403701"
    Local $mysqlpsw = "QtL7T9U5GV"

The DB is one table of 30 mysql tinytext fields... very simple indeed...

You can try to upload data to this DB and access (phpmyadmin or a random mysql browser app) to see the results.

Or you can use my ComputerPluckerDBbrowser (see at the end of this post) a script to collect and manage the data.

cpdbb1.PNG.f3d44dcba6515f9e30382d7adbb69c6f.PNG

PRIVACY warning: you are uploading data of your PC account and PC data, test as your risk (or test in another account...)

 

I also created a small post in a blog for not so geek friends, and I have a more advanced version of the data browser, you can have more info lookin' here. 😀

Attached you will find the code, and all the necessary includes are at this >link<.

ComputerPlucker.EXE is downloadable >HERE<

ComputerPluckerDBbrowser.EXE is downloadable >HERE<

 

ComputerPluckerDBbrowser_LITE.au3

 

ComputerPlucker.au3

cp1.JPG

Edited by t0nZ
V.3.7.8 out
Link to comment
Share on other sites

Nice GUI :)

;_ArrayDisplay($PList, "Running Processes", -1, 0, "", "|", "#|Process|ID") ; <<<<< this crashes
_ArrayDisplay($PList, "Running Processes", "", 0, "|", "Process|ID")

;also, "StringLeft(@WindowsDir, 2)" is better than "c:", as c: may not exist.

 

Edited by argumentum

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

lol, I'm a pain. I also added these.

#NoTrayIcon

... ...

Global Const $appname = "Computer Plucker", $Ver = "V.3.0.1 BETA"
If WinExists("[TITLE:" & $appname  & "(" & $Ver & ");CLASS:AutoIt v3;]") Then
    WinActivate("[TITLE:" & $appname & ";CLASS:AutoIt v3 GUI;]")
    Exit 3 ; as 1 and 2, I leave for internal AutoIt
EndIf
AutoItWinSetTitle($appname & "(" & $Ver & ") on PID: " & @AutoItPID)
SplashTextOn($appname & " is loading...", "", 250, 0)
If FileGetSize(StringTrimRight(@ScriptFullPath, 4) & ".ico") Then TraySetIcon(StringTrimRight(@ScriptFullPath, 4) & ".ico")
TraySetState(1) ; $TRAY_ICONSTATE_SHOW (1) = Shows the tray icon (default)
... ...

$MainGUI = GUICreate($appname & " - " & $Ver, 400, 455, -1, -1, 0x00CA0080, $WS_EX_ACCEPTFILES)
DllCall('shell32.dll', 'long', 'SetCurrentProcessExplicitAppUserModelID', 'wstr', $appname & $Ver) ; look at _WinAPI_SetCurrentProcessExplicitAppUserModelID()
If FileGetSize(StringTrimRight(@ScriptFullPath, 4) & ".ico") Then GUISetIcon(StringTrimRight(@ScriptFullPath, 4) & ".ico") ; http://www.rw-designer.com/icon-detail/4560 

... ...

GUISetState(@SW_SHOW)
SplashOff()
TraySetState(2) ; $TRAY_ICONSTATE_HIDE (2) = Destroys/Hides the tray icon
#EndRegion - Loading GUI with Infomation


;;; and if the above is true, then might as well

        Case $GUI_EVENT_CLOSE
            GUISetState(@SW_HIDE)
            funcExit()
... ...

        Case $ProcessList
            $PList = ProcessList()
            AdlibRegister("_ArrayDisplay_AddIcon", 100)
            GUICtrlSetState($ProcessList, $GUI_DISABLE)
            _ArrayDisplay($PList, "Running Processes", "", 0, "|", "Process|ID")
            GUICtrlSetState($ProcessList, $GUI_ENABLE)
            AdlibUnRegister("_ArrayDisplay_AddIcon") ; just in case "_ArrayDisplay_AddIcon()" failed

... ...

Func _ArrayDisplay_AddIcon()
    If FileGetSize(StringTrimRight(@ScriptFullPath, 4) & ".ico") Then
        If WinExists("[TITLE:Running Processes;CLASS:AutoIt v3 GUI;]") Then
            AdlibUnRegister("_ArrayDisplay_AddIcon")
            GUISetIcon(StringTrimRight(@ScriptFullPath, 4) & ".ico", -1, WinGetHandle("[TITLE:Running Processes;CLASS:AutoIt v3 GUI;]"))
        EndIf
    Else
        AdlibUnRegister("_ArrayDisplay_AddIcon")
    EndIf
EndFunc

that gives the option of a custom icon and independence from other uncompiled scripts.

Edit: ...and it may take some time while collecting data so the SplashTextOn() and also on exit "@SW_HIDE" it first and ... hope you like the ideas :) 

Edited by argumentum
more "great" ideas ;)

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

bug report: Tools > Details on Drive... when i select any of my drives, i get the Drive Info window with all the details except for the temperature which is left blank, and a COM error with all fiields blank except err.number is: 00000000

if this works for you, then i'd happily investigate this further on my pc tomorrow.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

13 hours ago, orbs said:

bug report: Tools > Details on Drive... when i select any of my drives, i get the Drive Info window with all the details except for the temperature which is left blank, and a COM error with all fiields blank except err.number is: 00000000

if this works for you, then i'd happily investigate this further on my pc tomorrow.

Hi @orbs I already noticed that, not working also for me (tested in 4  machines..) in the original script the error was not managed so I made some research and I substituted that piece of code but for now my only result is a managed error 😄...

Thank you for your interest, if you find a way to fix it you are always welcome 😅

Link to comment
Share on other sites

Ok V.3.7.5 is out since some days, perfectable but ok for my basic needs, meanwhile I have the companion app to remote collect data about the machines, the way I'am doing this is a bit "convoluted..." but I have a particular network situation..

Btw, more high level details in this blog post

 

And I am using the "about" from @Professor_Bernd .. Thank you !

Cattura.JPG.6819dc422461e47b71afd7b8dbfb4b97.JPG

Link to comment
Share on other sites

9 minutes ago, t0nZ said:

Many tanks

🔫 🔫 🔫 🔫
🚗🚗🚗🚗 (Cars + squirt guns = Tanks)

I think you meant thanks ;) 

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

Nice work! 👍

I downloaded "cp-includes.zip" and "ComputerPlucker.au3" and unzipped them together into one folder. Then started the "ComputerPlucker.au3" with Pau3. Unfortunately no pictures are displayed. (see screenshot). Did I do something wrong?

62900040_Picturesmissing.jpg.148bdb50d384943abe76b6a94fdb7fbf.jpg

 

Suggestion for the version info: Maybe you can sort the versions descending, so from new to old? If there are more versions, you always see the newest first.

Thanks for using my about dialog! :)

Bernd.

Link to comment
Share on other sites

The issue is in line 3914

GUICtrlCreatePic("C:\autoit\ComputerPlucker\NSC_fs_red.jpg", $iCtrls_Left + 10, 145, $iCtrls_Width - 20, 130) ; NSC added

This should fix it:

GUICtrlCreatePic(@ScriptDir & "\NSC_fs_red.jpg", $iCtrls_Left + 10, 145, $iCtrls_Width - 20, 130) ; NSC added

😉

 

Btw, very nice GUI design. 👍

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • 2 weeks later...

V.3.7.8 Out.

Various improvements, see the change log.

And changed the CPU realtime usage monitor, in the original script there was a typeperf.exe running in background all the time writing a text file to be read... never liked that system.

Placed instead the code from this post  , wmic query and more eyecandy 😉

 

Link to comment
Share on other sites

  • 5 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...