eseuk Posted May 8, 2014 Share Posted May 8, 2014 expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #include <Array.au3> Global $sIni = @ScriptDir& "\Monitoring.ini" Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Form1", 615, 438, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize") GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore") ;input1 for the max value (critical) $Input1 = GUICtrlCreateInput("Input1", 128, 48, 137, 21) GUICtrlSetOnEvent($Input1, "Input1Change") ;input2 for the max value (warning) $Input2 = GUICtrlCreateInput("Input2", 304, 48, 161, 21) GUICtrlSetOnEvent($Input2, "Input2Change") $List1 = GUICtrlCreateList("", 24, 48, 89, 188) GUICtrlSetData($List1, "C|D|G|X") GUICtrlSetOnEvent($List1, "List1Click") $Button1 = GUICtrlCreateButton("Button1", 136, 96, 137, 33) GUICtrlSetOnEvent($Button1, "Button1Click") GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func Button1Click() ;IniWrite ( "filename", "section", "key", "value" ) IniWrite($sIni,"Config HDD",GUICtrlRead($List1),GUICtrlRead($Input1)&"|"&GUICtrlRead($Input2)) Local $aArray = IniReadSection($sIni, "Config HDD") ; Check if an error occurred. If Not @error Then ; Enumerate through the array displaying the keys and their respective values. For $i = 1 To $aArray[0][0] ConsoleWrite(@CR&"Key: " & $aArray[$i][0] & @CRLF & "Value: " & $aArray[$i][1]) Next EndIf EndFunc Func Form1Close() Exit EndFunc Hi every one , I'm starting with autoIt. I would like to monitor my hard drives, and generate an alert. I have two level alert one for the warning and the other for critical this based on the free space and each disk has a different configuration of space to be monitored. I use an ini file to save each configuration. For each drive ill like to check the free space and generate a warning or critical alert I can not parse my ini file to read the minimum and maximum levels of my disk Could someone help please. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 8, 2014 Moderators Share Posted May 8, 2014 eseuk,You are reading the ini file correctly so what do you mean when you say you are having trouble parsing it? StringSplit will break out the 2 values for you to use. Please explain further. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
eseuk Posted May 8, 2014 Author Share Posted May 8, 2014 Hello M23 thank for you quick answer, In my ini file I have several lines [Config HDD] C = 5 | 10 D = 5 | 20 X = 2 | 5 I would like for each line check if the disk space is less than 5 (disk C for example) generate critical alert if it is less than 10 alert warning and therefore do this for all disks that are in the list. Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted May 8, 2014 Moderators Solution Share Posted May 8, 2014 eseuk,Not too difficult. What have you tried so far that has not worked? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
eseuk Posted May 8, 2014 Author Share Posted May 8, 2014 M23, you're right it was not difficult just that I had a problem understanding. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 8, 2014 Moderators Share Posted May 8, 2014 eseuk,Delighted to hear that you got it working. Please post the code you used so others can learn as well. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
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