Addextender("WWIPG34I.DLL") AddExtender("wwsop34i.DLL") AddExtender("WWWNT34i.DLL") AddExtender("wproc34I.dll") IntControl(33, 0, 0, 0, 0) IntControl(49,1,0,0,0) key=RegExistkey(@Regmachine,"SOFTWARE\Arconi") if key != 1 iniloc=Askline("Setup","Cannot find your monitor.ini file. Please enter the path to the server it's located on. It should be formatted as: \\servername","",0) key=RegCreatekey(@REGMACHINE, "SOFTWARE\Arconi") RegSetValue(key, "[Path]", iniloc) RegClosekey(key) else iniloc=RegQueryValue(@REGMACHINE, "SOFTWARE\Arconi[Path]") endif monpath="%iniloc%\Network_Monitor" tech=strcat(monpath,"\SrvrMntr1.ini") :top mon=IniReadPvt("MNTR","ServerLoc", "", tech ) ini=strcat(mon,"\*.*") srvscnt=FileItemize(ini) num=itemcount(srvscnt,@tab) sm="" list="" myvariable3="" domloc=IniReadPvt("MNTR","Domain", "", tech ) vers="Network Monitor Ver 5.2.1" monitorSVC = wntSvcStatus(iniloc,"NetworkMonitor",1000,0) If monitorSVC==@FALSE monsvc= "Not Installed" monclr= "255|0|0" montxclr="255|255|255" else monitorSVC = wntSvcStatus(iniloc,"NetworkMonitor",1000,2) If monitorSVC== 4 monsvc= "Running" monclr= "0|255|0" montxclr="DEFAULT" else monsvc= "Not Running" monclr= "255|0|0" montxclr="255|255|255" endif endif #DefineFunction ListRemoteProcesses(nmsrv,username,password) ;*************************************************************************** ;** ListRemoteProcesses(computername,username,password) ;** Lists processes on a remote computer. ;** ;** Parameters: ;** ComputerName:Computer name without \\, and "" for local. ;** ;** Note that root/cimv2 is a namespace. For example, within the \root namespace are two instances of namespace. ;** One is "Default", and the other is "Cimv2." These instances represent the \root\default, and \root\cimv2 namespaces, ;** respectively. In other words, this shouldn't be changed. ;** ;** UserName: User name to run program as. In format DOMAIN\User or just User for local, "" for ;** current user running script. MUST be "" for local computer or the function will fail. ;** ;** Password: Password for user or "" if username is "". ;** ;** Returns: ;** a tab delimited list of process names and IDs. ;** The return value, 'process list' is returned in the following format: ;** [processname|processid]@TAB[processname|processid] ;*************************************************************************** list = "" Locator = ObjectOpen("WbemScripting.SWbemLocator") Service = Locator.ConnectServer(nmsrv,"root/cimv2",username,password) Security = Service.Security_ Security.ImpersonationLevel = 3 Instance = Service.InstancesOf("win32_process") hEnum = ObjectCollectionOpen(Instance) While 1 Obj = ObjectCollectionNext(hEnum) If Obj == 0 Then Break list = StrCat(list,@tab,Obj.name,"|",Obj.processid) EndWhile list = StrTrim(list) ObjectCollectionClose(hEnum) ObjectClose(Instance) ObjectClose(Security) ObjectClose(Service) ObjectClose(Locator) Return list #EndFunction #DefineFunction KillRemoteProcess(nmsrv, username, password, processname_id, type) ;*************************************************************************** ;** KillRemoteProcess(computername, username, password, processname_id, type) ;** Kills a process on a remote computer. ;** ;** Parameters: ;** ComputerName: Computer name without \\, and "" for local. ;** UserName: User name to run program as. In format DOMAIN\User or just User for local, "" for ;** current user running script. MUST be "" for local computer or the function will fail. ;** Password: Password for user or "" if username is "". ;** processname_id: process name or process id ;** type: 0-process name passed, 1-process id passed ;** ;** Returns: ;** 1-success, 0-failure. ;*************************************************************************** Locator = ObjectOpen("WbemScripting.SWbemLocator") Service = Locator.ConnectServer(nmsrv,"root/cimv2",username,password) Security = Service.Security_ Security.ImpersonationLevel = 3 Instance = Service.InstancesOf("win32_process") hEnum = ObjectCollectionOpen(Instance) ;if type !=0 and type !=1 ; Message("KillRemoteProcess Error","invalid type specified") ; return @false ; endif if type == 0 While 1 Obj = ObjectCollectionNext(hEnum) if Obj == 0 Then Break if StrLower(Obj.name)==StrLower(processname_id) Obj.Terminate endif EndWhile else if type == 1 While 1 Obj = ObjectCollectionNext(hEnum) if Obj == 0 Then Break if Obj.Processid==processname_id Obj.Terminate endif EndWhile else Message("KillRemoteProcess Error","invalid type specified") return @false endif endif ObjectCollectionClose(hEnum) ObjectClose(Instance) ObjectClose(Security) ObjectClose(Service) ObjectClose(Locator) Return @true #EndFunction #DEFINESUBROUTINE MonitorProc(Handle,DialogMessage,DialogControlID,param4,param5) MSG_Initialization=0 Butn_push=2 ListSelect=7 Radio_selct=3 switch (DialogMessage) case MSG_Initialization DialogProcOptions(Handle, ListSelect, 1); Pass item listbox selection changes. DialogProcOptions(Handle, Butn_push, 1); PushButton event break; case ListSelect switch DialogControlID case 002 sSelection = DialogControlGet(Handle,2,6); Get selection c=strcat(mon,"\",sSelection) nmsrv=IniReadPvt("NAME","Srv", "", c ) nmsrv1=strcat(nmsrv,".",domloc) DialogControlSet(Handle,12,4,"%nmsrv% System Info") pngGd=ipping(nmsrv1,5) ipinf=ipHost2Addr(nmsrv1, 5) selection=FileExtension( sSelection ) if selection=="off" DialogControlSet(Handle,25,4,"SYSTEM IS NOT BEING MONITORED") else DialogControlSet(Handle,25,4,"") endif png_only=IniReadPvt("NAME","Sys", "", c ) If png_only==1 DialogControlSet(Handle,34,5,"Retrieving Information") DialogControlSet(Handle,36,5,"Retrieving Information") else DialogControlSet(Handle,34,5,"Pinged Only") DialogControlSet(Handle,36,5,"Pinged Only") endif DialogControlSet(Handle,15,4,"") DialogControlSet(Handle,16,4,"") DialogControlSet(Handle,17,4,"") DialogControlSet(Handle,18,4,"") DialogControlSet(Handle,19,4,"") DialogControlSet(Handle,20,4,"") DialogControlSet(Handle,43,4,"") DialogControlSet(Handle,44,4,"") DialogControlSet(Handle,45,4,"") DialogControlSet(Handle,46,4,"") DialogControlSet(Handle,47,4,"") sSelection = DialogControlGet(Handle,2,6); Get selection c=strcat(mon,"\",sSelection) nmsrv=IniReadPvt("NAME","Srv", "", c ) nmsrv1=strcat(nmsrv,".",domloc) DialogControlSet(Handle,12,4,"%nmsrv% System Info") pngGd=ipping(nmsrv1,5) ipinf=ipHost2Addr(nmsrv1, 5) selection=FileExtension( sSelection ) if selection=="off" DialogControlSet(Handle,25,4,"SYSTEM IS NOT BEING MONITORED") else DialogControlSet(Handle,25,4,"") endif png_only=IniReadPvt("NAME","Sys", "", c ) If png_only==1 DialogControlState(Handle,26,3,1) srvcs=IniItemizePvt("SERVICE", c ) sv=itemcount(srvcs,@tab) if sv==0 DialogControlSet(Handle,21,4,"") else srvcs_fn="" for s= 1 to sv scntrl=1 svps=itemextract(s,srvcs,@tab) svc_var=IniReadPvt("SERVICE",svps, "", c ) dvcnm%scntrl%=strcat(svps," = ",svc_var) srvcs_fn=ItemInsert( dvcnm%scntrl%,0,srvcs_fn,@TAB) scntrl=scntrl+1 next DialogControlSet(Handle,21,5,srvcs_fn) endif dvs=IniItemizePvt("DRV", c ) dv=itemcount(dvs,@tab) if dv==0 DialogControlSet(Handle,15,4,"") DialogControlSet(Handle,16,4,"") DialogControlSet(Handle,17,4,"") DialogControlSet(Handle,18,4,"") DialogControlSet(Handle,19,4,"") DialogControlSet(Handle,20,4,"") DialogControlSet(Handle,43,4,"") DialogControlSet(Handle,44,4,"") DialogControlSet(Handle,45,4,"") DialogControlSet(Handle,46,4,"") DialogControlSet(Handle,47,4,"") else dcntrl=15 var=1 for d= 1 to dv if d > 9 driveNum="drive" var="10" else driveNum="drive0" endif dvps=itemextract(d,dvs,@tab) dvcnm=strcat(driveNum,var) dcnt=IniReadPvt("DRV",dvps, "", c ) dfinal=strcat(dvps," = ",dcnt) DialogControlSet(Handle,dcntrl,4,dfinal) if dcntrl==20 then dcntrl=45 var=var+1 dcntrl=dcntrl+1 next endif else srvcs_fn="" DialogControlSet(Handle,15,4,"") DialogControlSet(Handle,16,4,"") DialogControlSet(Handle,17,4,"") DialogControlSet(Handle,18,4,"") DialogControlSet(Handle,19,4,"") DialogControlSet(Handle,20,4,"") DialogControlSet(Handle,43,4,"") DialogControlSet(Handle,44,4,"") DialogControlSet(Handle,45,4,"") DialogControlSet(Handle,46,4,"") DialogControlSet(Handle,47,4,"") DialogControlState(Handle,26,4,1) DialogControlSet(Handle,21,5,srvcs_fn) endif cnt=IniReadPvt("CONTACT","Mgr", "", c ) email=IniReadPvt("CONTACT","email", "", c ) DialogControlSet(Handle,27,4,nmsrv) DialogControlSet(Handle,24,4,email) DialogControlSet(Handle,22,4,cnt) DialogControlSet(Handle,14,4,ipinf) dot="." ;find sub net sub1=ItemExtract (1,ipinf,dot) sub2=ItemExtract (2,ipinf,dot) sub3=ItemExtract (3,ipinf,dot) location=strcat(sub1,".",sub2,".",sub3) sub_net=IniReadPvt("SUBNETS",location, "", tech) DialogControlSet(Handle,42,4,sub_net) if pngGd==@true if png_only==0 DialogControlSet(Handle,54,4,"") DialogControlSet(Handle,39,4,"") DialogControlSet(Handle,38,4,"") DialogControlSet(Handle,37,4,"") DialogControlSet(Handle,34,5,"Pinged Only") DialogControlSet(Handle,36,5,"Pinged Only") break else availablebytes = "" cachebytes = "" totalworkset = "" physicalmemMB = "" if WinVersion(4) == 4 availablebytes = tGetData("\\%nmsrv%\Memory\Available bytes",0)/1024 cachebytes = tGetData("\\%nmsrv%\Memory\Cache bytes",0)/1024 totalworkset = tGetData("\\%nmsrv%\Process(_Total)\Working Set",0)/1024 physicalmemMB = (availablebytes + cachebytes + totalworkset)/1024 DialogControlSet(Handle,54,4,physicalmemMB) DialogControlSet(Handle,39,4,availablebytes) DialogControlSet(Handle,38,4,cachebytes) DialogControlSet(Handle,37,4,totalworkset) else Message("tGetData", "Is designed to run on Windows Server Only") break endif newlist="" If png_only==1 serviceList=wntSvcList("\\%nmsrv%","", 1|300|0 ) serviceCount=ItemCount( serviceList, @TAB ) For service = 1 to serviceCount servicename=ItemExtract( service, serviceList, @TAB ) rename=StrScan (servicename, "|"," 1", @FWDSCAN) lengthA=rename - 1 lengthB=rename + 1 status=StrSub (servicename, lengthB, -1) servicename=StrSub (servicename, 1, lengthA) if status == 1 then status= "STOPPED" if status == 2 then status= "START_PENDING" if status == 3 then status= "STOP_PENDING" if status == 4 then status= "RUNNING" if status == 5 then status= "CONTINUE_PENDING" if status == 6 then status= "PAUSE_PENDING" if status == 7 then status= "PAUSED" servicename=strcat(servicename," --- ",status) newlist=ItemInsert(servicename,-1,newlist,@tab) next endif DialogControlSet(Handle,34,5,newlist) username = "" password = "" workdir = "" If png_only==1 list=ListRemoteProcesses(nmsrv,username,password) DialogControlSet(Handle,36,5,list) ObjLocator = ObjectCreate("WbemScripting.SWbemLocator") objService = objLocator.ConnectServer("%nmsrv%","root/cimv2","","") objSecurity = objService.Security_ objSecurity.ImpersonationLevel = 3 class = "Win32_ComputerSystem" ; query instances query = "SELECT * FROM Win32_ComputerSystem" colInstances = objService.ExecQuery(query) ; loop once for each instance ForEach objInstance in colInstances ;Check if Object is EMPTY type = ObjectTypeGet(objInstance) if type=="EMPTY" then break ; obtain properties propAdminPasswordStatus = objInstance.AdminPasswordStatus propAutomaticResetBootOption = objInstance.AutomaticResetBootOption propAutomaticResetCapability = objInstance.AutomaticResetCapability propBootOptionOnLimit = objInstance.BootOptionOnLimit propBootOptionOnWatchDog = objInstance.BootOptionOnWatchDog propBootROMSupported = objInstance.BootROMSupported propBootupState = objInstance.BootupState propCaption = objInstance.Caption propChassisBootupState = objInstance.ChassisBootupState propCreationClassName = objInstance.CreationClassName propCurrentTimeZone = objInstance.CurrentTimeZone propDaylightInEffect = objInstance.DaylightInEffect propDescription = objInstance.Description propDomain = objInstance.Domain propDomainRole = objInstance.DomainRole propEnableDaylightSavingsTime = objInstance.EnableDaylightSavingsTime propFrontPanelResetStatus = objInstance.FrontPanelResetStatus propInfraredSupported = objInstance.InfraredSupported propInitialLoadInfo = objInstance.InitialLoadInfo propInstallDate = objInstance.InstallDate propKeyboardPasswordStatus = objInstance.KeyboardPasswordStatus propLastLoadInfo = objInstance.LastLoadInfo propManufacturer = objInstance.Manufacturer propModel = objInstance.Model propName = objInstance.Name propNameFormat = objInstance.NameFormat propNetworkServerModeEnabled = objInstance.NetworkServerModeEnabled propNumberOfProcessors = objInstance.NumberOfProcessors propOEMLogoBitmap = objInstance.OEMLogoBitmap propOEMStringArray = objInstance.OEMStringArray propPartOfDomain = objInstance.PartOfDomain propPauseAfterReset = objInstance.PauseAfterReset propPowerManagementCapabilitie = objInstance.PowerManagementCapabilities propPowerManagementSupported = objInstance.PowerManagementSupported propPowerOnPasswordStatus = objInstance.PowerOnPasswordStatus propPowerState = objInstance.PowerState propPowerSupplyState = objInstance.PowerSupplyState propPrimaryOwnerContact = objInstance.PrimaryOwnerContact propPrimaryOwnerName = objInstance.PrimaryOwnerName propResetCapability = objInstance.ResetCapability propResetCount = objInstance.ResetCount propResetLimit = objInstance.ResetLimit propRoles = objInstance.Roles propStatus = objInstance.Status propSupportContactDescription = objInstance.SupportContactDescription propSystemStartupDelay = objInstance.SystemStartupDelay propSystemStartupOptions = objInstance.SystemStartupOptions propSystemStartupSetting = objInstance.SystemStartupSetting propSystemType = objInstance.SystemType propThermalState = objInstance.ThermalState propTotalPhysicalMemory = objInstance.TotalPhysicalMemory propUserName = objInstance.UserName propWakeUpType = objInstance.WakeUpType propWorkgroup = objInstance.Workgroup Next ; close object handles ObjectClose(colInstances) ObjectClose(objSecurity) ObjectClose(objService) ObjectClose(objLocator) ; build display list displaylist = "" displaylist=strcat(displaylist,@TAB, "AdminPasswordStatus = ", UDFFormat4Display("propAdminPasswordStatus")) displaylist=strcat(displaylist,@TAB, "AutomaticResetBootOption = ", UDFFormat4Display("propAutomaticResetBootOption")) displaylist=strcat(displaylist,@TAB, "AutomaticResetCapability = ", UDFFormat4Display("propAutomaticResetCapability")) displaylist=strcat(displaylist,@TAB, "BootOptionOnLimit = ", UDFFormat4Display("propBootOptionOnLimit")) displaylist=strcat(displaylist,@TAB, "BootOptionOnWatchDog = ", UDFFormat4Display("propBootOptionOnWatchDog")) displaylist=strcat(displaylist,@TAB, "BootROMSupported = ", UDFFormat4Display("propBootROMSupported")) displaylist=strcat(displaylist,@TAB, "BootupState = ", UDFFormat4Display("propBootupState")) displaylist=strcat(displaylist,@TAB, "Caption = ", UDFFormat4Display("propCaption")) displaylist=strcat(displaylist,@TAB, "ChassisBootupState = ", UDFFormat4Display("propChassisBootupState")) displaylist=strcat(displaylist,@TAB, "CreationClassName = ", UDFFormat4Display("propCreationClassName")) displaylist=strcat(displaylist,@TAB, "CurrentTimeZone = ", UDFFormat4Display("propCurrentTimeZone")) displaylist=strcat(displaylist,@TAB, "DaylightInEffect = ", UDFFormat4Display("propDaylightInEffect")) displaylist=strcat(displaylist,@TAB, "Description = ", UDFFormat4Display("propDescription")) displaylist=strcat(displaylist,@TAB, "Domain = ", UDFFormat4Display("propDomain")) displaylist=strcat(displaylist,@TAB, "DomainRole = ", UDFFormat4Display("propDomainRole")) displaylist=strcat(displaylist,@TAB, "EnableDaylightSavingsTime = ", UDFFormat4Display("propEnableDaylightSavingsTime")) displaylist=strcat(displaylist,@TAB, "FrontPanelResetStatus = ", UDFFormat4Display("propFrontPanelResetStatus")) displaylist=strcat(displaylist,@TAB, "InfraredSupported = ", UDFFormat4Display("propInfraredSupported")) displaylist=strcat(displaylist,@TAB, "InitialLoadInfo = ", UDFFormat4Display("propInitialLoadInfo")) displaylist=strcat(displaylist,@TAB, "InstallDate = ", UDFFormat4Display("propInstallDate")) displaylist=strcat(displaylist,@TAB, "KeyboardPasswordStatus = ", UDFFormat4Display("propKeyboardPasswordStatus")) displaylist=strcat(displaylist,@TAB, "LastLoadInfo = ", UDFFormat4Display("propLastLoadInfo")) displaylist=strcat(displaylist,@TAB, "Manufacturer = ", UDFFormat4Display("propManufacturer")) displaylist=strcat(displaylist,@TAB, "Model = ", UDFFormat4Display("propModel")) displaylist=strcat(displaylist,@TAB, "Name = ", UDFFormat4Display("propName")) displaylist=strcat(displaylist,@TAB, "NameFormat = ", UDFFormat4Display("propNameFormat")) displaylist=strcat(displaylist,@TAB, "NetworkServerModeEnabled = ", UDFFormat4Display("propNetworkServerModeEnabled")) displaylist=strcat(displaylist,@TAB, "NumberOfProcessors = ", UDFFormat4Display("propNumberOfProcessors")) displaylist=strcat(displaylist,@TAB, "OEMLogoBitmap = ", UDFFormat4Display("propOEMLogoBitmap")) displaylist=strcat(displaylist,@TAB, "OEMStringArray = ", UDFFormat4Display("propOEMStringArray")) displaylist=strcat(displaylist,@TAB, "PartOfDomain = ", UDFFormat4Display("propPartOfDomain")) displaylist=strcat(displaylist,@TAB, "PauseAfterReset = ", UDFFormat4Display("propPauseAfterReset")) displaylist=strcat(displaylist,@TAB, "PowerManagementCapabilities = ", UDFFormat4Display("propPowerManagementCapabilitie")) displaylist=strcat(displaylist,@TAB, "PowerManagementSupported = ", UDFFormat4Display("propPowerManagementSupported")) displaylist=strcat(displaylist,@TAB, "PowerOnPasswordStatus = ", UDFFormat4Display("propPowerOnPasswordStatus")) displaylist=strcat(displaylist,@TAB, "PowerState = ", UDFFormat4Display("propPowerState")) displaylist=strcat(displaylist,@TAB, "PowerSupplyState = ", UDFFormat4Display("propPowerSupplyState")) displaylist=strcat(displaylist,@TAB, "PrimaryOwnerContact = ", UDFFormat4Display("propPrimaryOwnerContact")) displaylist=strcat(displaylist,@TAB, "PrimaryOwnerName = ", UDFFormat4Display("propPrimaryOwnerName")) displaylist=strcat(displaylist,@TAB, "ResetCapability = ", UDFFormat4Display("propResetCapability")) displaylist=strcat(displaylist,@TAB, "ResetCount = ", UDFFormat4Display("propResetCount")) displaylist=strcat(displaylist,@TAB, "ResetLimit = ", UDFFormat4Display("propResetLimit")) displaylist=strcat(displaylist,@TAB, "Roles = ", UDFFormat4Display("propRoles")) displaylist=strcat(displaylist,@TAB, "Status = ", UDFFormat4Display("propStatus")) displaylist=strcat(displaylist,@TAB, "SupportContactDescription = ", UDFFormat4Display("propSupportContactDescription")) displaylist=strcat(displaylist,@TAB, "SystemStartupDelay = ", UDFFormat4Display("propSystemStartupDelay")) displaylist=strcat(displaylist,@TAB, "SystemStartupOptions = ", UDFFormat4Display("propSystemStartupOptions")) displaylist=strcat(displaylist,@TAB, "SystemStartupSetting = ", UDFFormat4Display("propSystemStartupSetting")) displaylist=strcat(displaylist,@TAB, "SystemType = ", UDFFormat4Display("propSystemType")) displaylist=strcat(displaylist,@TAB, "ThermalState = ", UDFFormat4Display("propThermalState")) displaylist=strcat(displaylist,@TAB, "TotalPhysicalMemory = ", UDFFormat4Display("propTotalPhysicalMemory")) displaylist=strcat(displaylist,@TAB, "UserName = ", UDFFormat4Display("propUserName")) displaylist=strcat(displaylist,@TAB, "WakeUpType = ", UDFFormat4Display("propWakeUpType")) displaylist=strcat(displaylist,@TAB, "Workgroup = ", UDFFormat4Display("propWorkgroup")) displaylist = StrSub(displaylist,2,-1) endif endif endif case 036 processname=DialogControlGet(Handle,36,6) procid = ItemExtract(2,processname,"|") break case 034 ServiceName=DialogControlGet(Handle,34,6) renameSVC=StrScan (servicename, "-"," 1", @FWDSCAN) lengthC=renameSVC - 2 NewServiceName=StrSub (servicename, 1, lengthC) return(-2) endswitch case Butn_push switch DialogControlID case 055 KillRemoteProcess(nmsrv, username, password, procid,1) return(-2) case 057 svcstart(NewServiceName,nmsrv,NewServiceName) return(-2) case 056 svcstop(NewServiceName,nmsrv,NewServiceName) return(-2) case 052 file="c:\systemp.txt" fileo=fileopen(file,"Write") filewrite(fileo,displaylist) fileclose(fileo) MyDialogFormat=`WWWDLGED,6.1` MyDialogCaption= vers MyDialogX=082 MyDialogY=055 MyDialogWidth=394 MyDialogHeight=337 MyDialogNumControls=003 MyDialogProcedure=`DEFAULT` MyDialogFont=`DEFAULT` MyDialogTextColor=`DEFAULT` MyDialogBackground=`DEFAULT,DEFAULT` MyDialogConfig=0 MyDialog001=`107,319,036,012,PUSHBUTTON,DEFAULT,"OK",1,1,32,DEFAULT,DEFAULT,DEFAULT` MyDialog002=`251,319,036,012,PUSHBUTTON,DEFAULT,"Print",5,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog003=`005,007,380,308,ITEMBOX,displaylist,DEFAULT,DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT` ButtonPushed=Dialog("MyDialog") If ButtonPushed==5 print(file," DirGet( )",@NORMAL,0) TimeDelay(2) endif return(-2) case 062 run("iexplore.exe","www.arconi.com") return(-2) case 063 run("explorer",monpath) return(-2) endswitch endswitch return -1 #ENDSUBROUTINE #DefineFunction svcstart(NewServiceName,nmsrv,NewServiceName) ret = wntSvcStatus(nmsrv,NewServiceName,1000,2) aStatusbar(0,StrCat("Starting ",NewServiceName),StrCat("Starting the ",NewServiceName," service"),60,0) ;<--- start the status bar before the wntSvcStart() wntSvcStart(nmsrv, NewServiceName, 1000, "", "") ; start the service xx=0 While 1 ; loop until the service is running xx = xx+1 aStatusbar(1,StrCat("Starting ",NewServiceName),StrCat("Starting the ",NewServiceName," service"),60,xx+1) ;<--- it will start looking weird if it takes longer than 60 seconds ret = wntSvcStatus(nmsrv,NewServiceName,1000,2) If ret == 4 Then Break ; if running, break out of the while loop TimeDelay(1) EndWhile aStatusbar(1,StrCat("Starting ",NewServiceName),StrCat("Starting the ",NewServiceName," service"),60,60) ;<--- make it look like the status bar is at 100 percent during your Display() message TimeDelay(1) aStatusbar(2,StrCat("Starting ",NewServiceName),StrCat("Starting the ",NewServiceName," service"),60,60) ;<--- kill the status bar #EndFunction #DefineFunction svcstop(NewServiceName,nmsrv,NewServiceName) aStatusbar(0,StrCat("Stopping ",NewServiceName),StrCat("Stopping the ",NewServiceName," service"),60,0) ;<--- start the status bar before the wntSvcStart() wntSvcControl(nmsrv, NewServiceName, 1000, 1) ; stop the service xx = 0 While 1 ; loop until the service is stopped xx = xx+1 aStatusbar(1,StrCat("Stopping ",NewServiceName),StrCat("Stopping the ",NewServiceName," service"),60,xx) ;<--- this will look weird if it takes longer than 60 seconds ret = wntSvcStatus(nmsrv,NewServiceName,1000,2) If ret == 1 Then Break ; if stopped, break out TimeDelay(1) EndWhile aStatusbar(1,StrCat("Stopping ",NewServiceName),StrCat("Stopping the ",NewServiceName," service"),60,60) ;<--- make it look like it's at 100 percent during your Display() message TimeDelay(1) aStatusbar(2,StrCat("Stopping ",NewServiceName),StrCat("Stopping the ",NewServiceName," service"),60,60) ;<--- kill the status bar #EndFunction #DefineSubroutine udfFormat4Display(vname) value = %vname% ver = version() yyy = ObjectTypeGet(value) if StrIndex(yyy,"ARRAY",1,@Fwdscan) !=0 ;if array then create pipe delimited list arraylist="" cnt = ArrInfo(value,1)-1 if cnt < 30 for item = 0 To cnt arraylist = StrCat(arraylist,"|",value[item]) next ;remove leading pipe value=StrSub(arraylist,2,-1) else value = "***LARGE ARRAY***" endif endif return(value) #EndSubroutine #DEFINESUBROUTINE SystemProc(Handle,DialogMessage,DialogControlID,param4,param5) errormode(@off) switch (DialogMessage) case 0 DialogProcOptions(Handle, 2, 1) break; case 2 switch DialogControlID case 013 nmsrv=IniReadPvt("NAME","Srv", "", c ) nmsrv1=strcat(nmsrv,".",domloc) DialogControlSet(Handle,5,4,nmsrv) DialogControlSet(Handle,1,4,"Pinging ==> %ipinf% %nmsrv%") png=ipPing(nmsrv1, 3) err=ipGetLastErr() If png==@true good=strcat(ipinf," ==> Ping Succsessful") DialogControlSet(Handle,2,4,good) else bad=strcat(nmsrv1," ==> Ping Failed-[error code",err,"]") DialogControlSet(Handle,2,4,bad) endif if png_only==1 if png==@true sys_file="\\%nmsrv%\C$\MonitorTest.txt" accss=fileexist(sys_file) if accss==@true accs=strcat(nmsrv," is ACCESSIBLE [",sys_file," was found ]") accs1=strcat(nmsrv," is ACCESSIBLE") DialogControlSet(Handle,3,4,accs) DialogControlSet(Handle,4,4,accs1) else accs=strcat(nmsrv," is NOT accessible !!!") DialogControlSet(Handle,3,4,accs) DialogControlSet(Handle,4,4,accs) endif endif bd=0 pse=0 for s= 1 to sv pse=pse+1 If pse !=0 then delay(1) svps=itemextract(s,srvcs,@tab) svc_var=IniReadPvt("SERVICE",svps, "", c ) sys_tst=strcat(svps,"==>Testing Service") DialogControlSet(Handle,3,4,sys_tst) sver="1000" state_exist=wntSvcStatus("\\%nmsrv%", svps,sver,0) If state_exist==@false If wntSvcStatus("\\%nmsrv%", svps,0,0)==@true then sver="0" endif state_exist=wntSvcStatus("\\%nmsrv%", svps,sver,0) If state_exist==@false state_exist=wntSvcStatus("\\%nmsrv%", svps,0,0) if state_exist==@true then sver="0" endif If state_exist != 0 state=wntSvcStatus("\\%nmsrv%", svps,1000,2) if state==4 goodsv="Service is up." dsv=strcat(svps," = ",goodsv) DialogControlSet(Handle,3,4,dsv) else bd=bd +1 badsv="Service down" dsv=strcat(svps," = ",badsv) DialogControlSet(Handle,3,4,dsv) DialogControlSet(Handle,10,4,dsv) endif else bd=bd +1 dsv=strcat(svps," - service is not installed.") DialogControlSet(Handle,10,4,dsv) endif if bd !=0 warn="Service Check Unsuccessfull!" DialogControlSet(Handle,3,4,warn) else warn="Service Check Successfull" DialogControlSet(Handle,10,4,warn) endif next DialogControlState(Handle,14,4,1) break endif case 012 return(-1) endswitch endswitch return(-2) #ENDSUBROUTINE MonitorFormat=`WWWDLGED,6.1` MonitorCaption=vers MonitorX=100 MonitorY=109 MonitorWidth=406 MonitorHeight=359 MonitorNumControls=063 MonitorProcedure=`MonitorProc` MonitorFont=`DEFAULT` MonitorTextColor=`DEFAULT` MonitorBackground=`DEFAULT,DEFAULT` MonitorConfig=0 Monitor001=`019,195,036,012,PUSHBUTTON,DEFAULT,"Exit",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor002=`069,027,114,196,ITEMBOX,srvscnt,DEFAULT,DEFAULT,3,256,"Microsoft Sans Serif|6656|40|34","0|0|0",DEFAULT` Monitor003=`019,029,036,012,PUSHBUTTON,DEFAULT,"OFF",2,4,DEFAULT,"Microsoft Sans Serif|5632|40|34","255|0|0",DEFAULT` Monitor004=`019,047,036,012,PUSHBUTTON,DEFAULT,"ON",3,5,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|128|0",DEFAULT` Monitor005=`019,065,036,012,PUSHBUTTON,DEFAULT,"EDIT",4,6,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|0|0",DEFAULT` Monitor006=`005,019,184,220,GROUPBOX,DEFAULT,DEFAULT,DEFAULT,7,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor007=`083,003,098,010,STATICTEXT,DEFAULT,"- Network Monitor Console",DEFAULT,1,DEFAULT,"Microsoft Sans Serif|8192|40|34","0|0|0",DEFAULT` Monitor008=`195,019,204,220,GROUPBOX,DEFAULT,"Server Information",DEFAULT,8,DEFAULT,"Microsoft Sans Serif|5632|70|34","128|128|128",DEFAULT` Monitor009=`015,107,044,012,PUSHBUTTON,DEFAULT,"Add System",1,9,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor010=`273,055,050,008,STATICTEXT,DEFAULT,"Services Monitored",DEFAULT,12,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor011=`013,301,032,008,STATICTEXT,DEFAULT,"IP Address->",DEFAULT,14,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor012=`005,239,394,114,GROUPBOX,DEFAULT,"System",DEFAULT,51,DEFAULT,"Microsoft Sans Serif|6656|70|34","128|128|128",DEFAULT` Monitor013=`213,031,040,008,STATICTEXT,DEFAULT,"System Name->",DEFAULT,28,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor014=`047,301,056,010,VARYTEXT,ipinf,DEFAULT,DEFAULT,15,512,"Microsoft Sans Serif|5632|70|34","0|0|255",DEFAULT` Monitor015=`209,143,052,008,VARYTEXT,drives01,DEFAULT,DEFAULT,16,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|0|255",DEFAULT` Monitor016=`209,151,052,008,VARYTEXT,drives02,DEFAULT,DEFAULT,17,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|0|255",DEFAULT` Monitor017=`209,159,052,008,VARYTEXT,drives03,DEFAULT,DEFAULT,18,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|0|255",DEFAULT` Monitor018=`209,167,052,008,VARYTEXT,drives04,DEFAULT,DEFAULT,19,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|0|255",DEFAULT` Monitor019=`271,143,052,008,VARYTEXT,drives05,DEFAULT,DEFAULT,20,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|0|255",DEFAULT` Monitor020=`271,151,052,008,VARYTEXT,drives06,DEFAULT,DEFAULT,21,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|0|255",DEFAULT` Monitor021=`203,065,188,060,ITEMBOX,sm,DEFAULT,DEFAULT,22,256,"Microsoft Sans Serif|5632|40|34","0|0|255","239|239|239"` Monitor022=`205,187,186,018,VARYTEXT,cntc,DEFAULT,DEFAULT,23,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|0|255",DEFAULT` Monitor023=`011,081,054,106,GROUPBOX,DEFAULT,DEFAULT,DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor024=`205,221,186,014,VARYTEXT,email,DEFAULT,DEFAULT,25,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|0|255",DEFAULT` Monitor025=`201,043,122,010,VARYTEXT,moff,"",DEFAULT,27,DEFAULT,"Microsoft Sans Serif|6656|40|34","255|0|0",DEFAULT` Monitor026=`335,043,050,010,STATICTEXT,DEFAULT,"PINGED ONLY",DEFAULT,43,1,"Microsoft Sans Serif|6656|40|34","0|0|255",DEFAULT` Monitor027=`249,031,078,010,VARYTEXT,nmsrv,DEFAULT,DEFAULT,15,512,"Microsoft Sans Serif|5632|70|34","0|0|255",DEFAULT` Monitor028=`015,139,044,012,PUSHBUTTON,DEFAULT,"Monitor Report",5,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor029=`127,251,052,008,STATICTEXT,DEFAULT,"Running Proccesess",DEFAULT,54,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor030=`015,123,044,012,PUSHBUTTON,DEFAULT,"Delete System",6,41,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor031=`015,091,044,012,PUSHBUTTON,DEFAULT,"Test System",8,41,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor032=`199,211,194,010,STATICTEXT,DEFAULT,"Secondary Email Contact_________________________________",DEFAULT,53,DEFAULT,"Microsoft Sans Serif|5632|40|34","128|128|128",DEFAULT` Monitor033=`199,177,192,010,STATICTEXT,DEFAULT,"Additional Information___________________________________",DEFAULT,46,DEFAULT,"Microsoft Sans Serif|5632|40|34","128|128|128",DEFAULT` Monitor034=`227,263,168,088,ITEMBOX,MyVariable3,DEFAULT,DEFAULT,48,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor035=`289,251,048,008,STATICTEXT,DEFAULT,"<------Services------>",DEFAULT,49,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor036=`123,263,100,088,ITEMBOX,list,DEFAULT,DEFAULT,37,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor037=`075,283,044,008,VARYTEXT,totalworkset,DEFAULT,DEFAULT,38,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor038=`075,275,044,008,VARYTEXT,cachebytes,DEFAULT,DEFAULT,38,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor039=`075,267,044,008,VARYTEXT,availablebytes,DEFAULT,DEFAULT,38,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor040=`199,133,194,008,STATICTEXT,DEFAULT,"Drives + Minimum Free space (KB)_________________________",DEFAULT,47,DEFAULT,"Microsoft Sans Serif|5632|40|34","128|128|128",DEFAULT` Monitor041=`029,267,042,008,STATICTEXT,DEFAULT,"Available bytes >",DEFAULT,45,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor042=`011,315,108,016,VARYTEXT,sub_net,DEFAULT,DEFAULT,44,DEFAULT,"Microsoft Sans Serif|6144|40|34","0|0|255",DEFAULT` Monitor043=`271,159,052,008,VARYTEXT,drives07,DEFAULT,DEFAULT,22,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|0|255",DEFAULT` Monitor044=`271,167,052,008,VARYTEXT,drives08,DEFAULT,DEFAULT,23,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|0|255",DEFAULT` Monitor045=`331,143,052,008,VARYTEXT,drives09,DEFAULT,DEFAULT,24,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|0|255",DEFAULT` Monitor046=`331,151,052,008,VARYTEXT,drives10,DEFAULT,DEFAULT,25,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|0|255",DEFAULT` Monitor047=`331,159,052,008,VARYTEXT,drives11,DEFAULT,DEFAULT,26,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|0|255",DEFAULT` Monitor048=`015,155,044,012,PUSHBUTTON,DEFAULT,"Monitor Settings",7,41,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor049=`035,275,036,008,STATICTEXT,DEFAULT,"Cache bytes >",DEFAULT,42,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor050=`025,283,046,008,STATICTEXT,DEFAULT,"Working set total >",DEFAULT,40,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor051=`013,255,058,008,STATICTEXT,DEFAULT,"Physical Memory (MB) >",DEFAULT,39,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor052=`021,337,088,010,PUSHBUTTON,DEFAULT,"Display Server System Information",11,57,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor053=`015,171,044,012,PUSHBUTTON,DEFAULT,"Help",9,52,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor054=`075,255,044,008,VARYTEXT,physicalmemMB,DEFAULT,DEFAULT,38,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor055=`183,249,038,010,PUSHBUTTON,DEFAULT,"Kill Process",10,56,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Monitor056=`239,249,042,010,PUSHBUTTON,DEFAULT,"Service STOP",12,55,DEFAULT,"Microsoft Sans Serif|5632|40|34","255|0|0",DEFAULT` Monitor057=`343,249,042,010,PUSHBUTTON,DEFAULT,"Service START",13,50,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|128|0",DEFAULT` Monitor058=`255,005,078,008,STATICTEXT,DEFAULT,"Network Monitor Service ->",DEFAULT,58,DEFAULT,"Microsoft Sans Serif|5632|70|34","0|0|0",DEFAULT` Monitor059=`335,005,058,008,VARYTEXT,MyVariable1,%monsvc%,DEFAULT,59,512,DEFAULT,%montxclr%,%monclr%` Monitor060=`007,003,034,010,STATICTEXT,DEFAULT,"ARCONI",DEFAULT,60,DEFAULT,"Microsoft Sans Serif|8192|70|34","0|0|0",DEFAULT` Monitor061=`041,003,040,010,STATICTEXT,DEFAULT,"SoftTools",DEFAULT,61,DEFAULT,"Microsoft Sans Serif|8192|70|34","0|0|255",DEFAULT` Monitor062=`015,215,044,010,PUSHBUTTON,DEFAULT,"www.arconi.com",14,62,128,"Microsoft Sans Serif|5632|1040|34","0|0|255",DEFAULT` Monitor063=`065,227,122,008,PUSHBUTTON,DEFAULT,"Open Monitor Folders - Logs, system ini files, etc.",15,63,DEFAULT,DEFAULT,DEFAULT,DEFAULT` ButtonPushed=Dialog("Monitor") Switch buttonpushed case 1 RunWait("%monpath%\SysUpdate.exe","") goto top break case 2 c=strcat(mon,"\",srvscnt) srvnm=IniReadPvt("NAME","Srv", "", c ) snm=strcat(srvnm,".off") FileRename( srvscnt, snm ) break case 3 c=strcat(mon,"\",srvscnt) srvnm=IniReadPvt("NAME","Srv", "", c ) snm=strcat(srvnm,".on") FileRename( srvscnt, snm ) break case 4 MyDialogFormat=`WWWDLGED,6.1` MyDialogCaption= '%vers% - Edit Monitor Sys INI' MyDialogX=519 MyDialogY=162 MyDialogWidth=182 MyDialogHeight=081 MyDialogNumControls=006 MyDialogProcedure=`DEFAULT` MyDialogFont=`DEFAULT` MyDialogTextColor=`DEFAULT` MyDialogBackground=`DEFAULT,DEFAULT` MyDialogConfig=0 MyDialog001=`041,061,036,012,PUSHBUTTON,DEFAULT,"OK",1,1,32,DEFAULT,DEFAULT,DEFAULT` MyDialog002=`095,061,036,012,PUSHBUTTON,DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog003=`011,013,048,012,RADIOBUTTON,value,"Edit values only",4,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog004=`011,035,050,012,RADIOBUTTON,value,"Edit actual ini file",3,4,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog005=`063,015,106,010,STATICTEXT,DEFAULT,"(Only allows changes to values in INI file)",DEFAULT,5,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog006=`065,037,092,010,STATICTEXT,DEFAULT,"(Opens INI file in NotePad for editing)",DEFAULT,5,DEFAULT,DEFAULT,DEFAULT,DEFAULT` ButtonPushed=Dialog("MyDialog") if value==4 file=strcat(mon,"\",srvscnt) gosub ini_up else f=strcat(mon,"\",srvscnt) run("notepad.exe",f) endif break case 5 gosub report goto TOP break case 6 d=AskYesNo("DELETE SYSTEM","Are you sure you want to delete %nmsrv% ?") if d==@YES then filedelete(c) break case 7 file=strcat(monpath,"\SrvrMntr1.ini") serverLog=IniReadPvt("LOGNAME","Location->TXT", "", file ) DownLog=IniReadPvt("LOGNAME","Location->Managment", "", file ) lastRun=IniReadPvt("MNTR","LastRunTime", "", file ) firstRun=IniReadPvt("MNTR","FirstRunTime", "", file ) waitTime=IniReadPvt("TIMEOUT","Seconds", "", file ) Mean=IniReadPvt("MEAN","Number", "", file ) EmailAlert00=IniReadPvt("MAILLIST","EmailAlert00", "", file ) EmailAlert01=IniReadPvt("MAILLIST","EmailAlert01", "", file ) EmailAlert02=IniReadPvt("MAILLIST","EmailAlert02", "", file ) EmailAlertAV=IniReadPvt("MAILLIST","EmailAlertAV", "", file ) MaintenanceFormat=`WWWDLGED,6.1` MaintenanceCaption=`%vers% - Maintenance` MaintenanceX=075 MaintenanceY=065 MaintenanceWidth=314 MaintenanceHeight=241 MaintenanceNumControls=028 MaintenanceProcedure=`DEFAULT` MaintenanceFont=`DEFAULT` MaintenanceTextColor=`DEFAULT` MaintenanceBackground=`DEFAULT,DEFAULT` MaintenanceConfig=4513740 Maintenance001=`261,049,036,012,PUSHBUTTON,DEFAULT,"Return",5,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Maintenance002=`083,097,174,010,VARYTEXT,serverLog,"Vary 1",DEFAULT,3,DEFAULT,"Microsoft Sans Serif|6144|40|34","0|0|255",DEFAULT` Maintenance003=`261,097,036,010,PUSHBUTTON,DEFAULT,"Open Log",2,4,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Maintenance004=`261,117,036,010,PUSHBUTTON,DEFAULT,"Open Log",4,4,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Maintenance005=`083,117,174,010,VARYTEXT,DownLog,"Vary 1",DEFAULT,3,DEFAULT,"Microsoft Sans Serif|6144|40|34","0|0|255",DEFAULT` Maintenance006=`013,097,068,010,STATICTEXT,DEFAULT,"Current Server Log:",DEFAULT,7,DEFAULT,"Microsoft Sans Serif|6656|40|34","0|0|0",DEFAULT` Maintenance007=`013,117,064,010,STATICTEXT,DEFAULT,"Current Down Log:",DEFAULT,7,DEFAULT,"Microsoft Sans Serif|6656|40|34","0|0|0",DEFAULT` Maintenance008=`059,025,128,010,VARYTEXT,lastRun,"Vary 3",DEFAULT,9,DEFAULT,"Microsoft Sans Serif|6656|40|34","0|0|0",DEFAULT` Maintenance009=`011,025,044,008,STATICTEXT,DEFAULT,"Last run Time:",DEFAULT,10,DEFAULT,"Microsoft Sans Serif|6656|40|34","0|0|0",DEFAULT` Maintenance010=`011,037,094,010,STATICTEXT,DEFAULT,"Current Wait time between runs:",DEFAULT,11,DEFAULT,"Microsoft Sans Serif|6656|40|34","0|0|0",DEFAULT` Maintenance011=`107,037,020,010,VARYTEXT,waitTime,"Vary 4",DEFAULT,12,DEFAULT,"Microsoft Sans Serif|5632|40|34","0|0|255",DEFAULT` Maintenance012=`131,037,032,010,STATICTEXT,DEFAULT,"(Seconds)",DEFAULT,13,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Maintenance013=`107,053,020,010,VARYTEXT,Mean,"Vary 5",DEFAULT,14,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Maintenance014=`011,053,092,010,STATICTEXT,DEFAULT,"Number of times script has run:",DEFAULT,15,DEFAULT,"Microsoft Sans Serif|6656|40|34","0|0|0",DEFAULT` Maintenance015=`013,159,082,010,STATICTEXT,DEFAULT,"Email Alert List; Standard:",DEFAULT,16,DEFAULT,"Microsoft Sans Serif|6656|40|34","128|128|128",DEFAULT` Maintenance016=`013,173,086,010,STATICTEXT,DEFAULT,"Email Alert List; Managment:",DEFAULT,16,DEFAULT,"Microsoft Sans Serif|6656|40|34","128|128|128",DEFAULT` Maintenance017=`013,189,092,010,STATICTEXT,DEFAULT,"Email Alert List; Phone/Pager:",DEFAULT,16,DEFAULT,"Microsoft Sans Serif|6656|40|34","128|128|128",DEFAULT` Maintenance018=`013,205,096,010,STATICTEXT,DEFAULT,"Email Alert List; Anti Virus Team:",DEFAULT,16,DEFAULT,"Microsoft Sans Serif|6656|40|34","128|128|128",DEFAULT` Maintenance019=`113,159,184,010,VARYTEXT,EmailAlert00,"Vary 1",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Maintenance020=`113,173,184,010,VARYTEXT,EmailAlert01,"Vary 1",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Maintenance021=`113,189,184,010,VARYTEXT,EmailAlert02,"Vary 1",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Maintenance022=`113,205,184,010,VARYTEXT,EmailAlertAV,"Vary 1",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Maintenance023=`261,025,036,012,PUSHBUTTON,DEFAULT,"Edit Settings",3,23,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Maintenance024=`003,139,302,090,GROUPBOX,DEFAULT,"Email Alert Addresses",DEFAULT,24,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Maintenance025=`003,083,302,052,GROUPBOX,DEFAULT,"Logs",DEFAULT,25,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Maintenance026=`133,053,020,010,STATICTEXT,DEFAULT,"Since",DEFAULT,26,DEFAULT,"Microsoft Sans Serif|6656|140|34","0|0|0",DEFAULT` Maintenance027=`157,055,086,018,VARYTEXT,firstRun,"Vary 1",DEFAULT,27,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Maintenance028=`003,013,250,068,GROUPBOX,DEFAULT,"Run Stats",DEFAULT,28,DEFAULT,DEFAULT,DEFAULT,DEFAULT` ButtonPushed=Dialog("Maintenance") replacement="\\mscis04\" if buttonpushed==5 then goto top if buttonpushed==3 then gosub INI_UP if buttonpushed==2 run("notepad.exe",serverLog) endif if buttonpushed==4 downLogNew=StrClean( downLog, ":", "$", @False, 1 ) downLogNew=strcat( replacement,downLogNew) run("notepad.exe",downLogNew) endif goto top break case 8 SystemTestFormat=`WWWDLGED,6.1` SystemTestCaption=`%vers% - System Test` SystemTestX=180 SystemTestY=180 SystemTestWidth=252 SystemTestHeight=169 SystemTestNumControls=014 SystemTestProcedure=`SystemProc` SystemTestFont=`DEFAULT` SystemTestTextColor=`DEFAULT` SystemTestBackground=`DEFAULT,0|0|0` SystemTestConfig=0 SystemTest001=`023,039,206,012,VARYTEXT,Ping_info,DEFAULT,DEFAULT,6,0,"Microsoft Sans Serif|6656|40|34","0|255|0","0|0|0"` SystemTest002=`067,101,174,012,VARYTEXT,ping,DEFAULT,DEFAULT,7,512,"Microsoft Sans Serif|6144|40|34","0|255|0","0|0|0"` SystemTest003=`023,057,208,018,VARYTEXT,sys_access,DEFAULT,DEFAULT,8,0,"Microsoft Sans Serif|6656|40|34","0|255|0","0|0|0"` SystemTest004=`067,117,174,012,VARYTEXT,access,DEFAULT,DEFAULT,15,512,"Microsoft Sans Serif|6144|40|34","0|255|0","0|0|0"` SystemTest005=`063,011,176,012,VARYTEXT,nmsrv,DEFAULT,DEFAULT,10,DEFAULT,"Microsoft Sans Serif|9728|40|34","0|0|255",DEFAULT` SystemTest006=`009,011,044,012,STATICTEXT,DEFAULT,"Testing --->",DEFAULT,5,DEFAULT,"Microsoft Sans Serif|8192|40|34","0|128|0",DEFAULT` SystemTest007=`009,101,056,008,STATICTEXT,DEFAULT,"Ping Test ----------->",DEFAULT,4,DEFAULT,"Microsoft Sans Serif|6144|40|34","0|128|0","0|0|0"` SystemTest008=`009,117,056,008,STATICTEXT,DEFAULT,"System Access --->",DEFAULT,12,DEFAULT,"Microsoft Sans Serif|6144|40|34","0|128|0","0|0|0"` SystemTest009=`009,133,056,008,STATICTEXT,DEFAULT,"Service Test -------->",DEFAULT,13,DEFAULT,"Microsoft Sans Serif|6144|40|34","0|128|0","0|0|0"` SystemTest010=`067,133,172,012,VARYTEXT,service,DEFAULT,DEFAULT,15,512,"Microsoft Sans Serif|6144|40|34","0|255|0","0|0|0"` SystemTest011=`013,077,224,012,STATICTEXT,DEFAULT,"_________________________________________________________________________",DEFAULT,14,512,"Microsoft Sans Serif|5632|40|34","255|255|255","0|0|0"` SystemTest012=`183,149,052,012,PUSHBUTTON,DEFAULT,"Exit",1,9,DEFAULT,"Microsoft Sans Serif|6144|40|34","255|0|0",DEFAULT` SystemTest013=`125,149,052,012,PUSHBUTTON,DEFAULT,"Start Test",2,11,DEFAULT,"Microsoft Sans Serif|5632|40|34","255|0|0",DEFAULT` SystemTest014=`035,149,068,012,STATICTEXT,DEFAULT,"Test Completed",DEFAULT,3,513,"Microsoft Sans Serif|7680|70|34","255|0|0",DEFAULT` ButtonPushed=Dialog("SystemTest") if ButtonPushed==0 then exit break case 9 file=strcat(monpath,"\SrvrMntr1.ini") help=IniReadPvt("HELP","fileloc", "", file ) run("iexplore.exe",help) break endswitch goto top :REPORT Time=TimeDate() srvs=strcat(monpath,"\ServerList") tech=strcat(monpath,"\SrvMntr1.ini") ini_log=strcat(monpath,"\Server_monitor_report.txt") f=fileopen(ini_log,"append") filewrite(f,"============================================================================") filewrite(f," Systems Monitor report for %time%") filewrite(f," Report includes:") filewrite(f," * Servers that are NOT being monitored.") filewrite(f," * Servers that ARE being monitored but may have listed services that are not being monitored.") filewrite(f," * Server list location %srvs%") filewrite(f,"============================================================================") filewrite(f,"============================================================================") DirChange(srvs) H=IniReadPvt( "LIST", "Location", "", tech) mon=strcat(srvs,"\*.on") mon1=strcat(srvs,"\*.off") srvscnt_on=FileItemize(mon) srvscnt_off=FileItemize(mon1) num_on=itemcount(srvscnt_on,@tab) num_off=itemcount(srvscnt_off,@tab) ends= num_on + num_off astatusbar(0,"Monitor Report","Building monitor report",ends,0) ;*****{SORT THRU LIST OF SERVERS}***** :SRV_ON For m = 1 to num_on mnt=1 x=itemextract(m,srvscnt_on,@tab) astatusbar(1,"Monitor Report","Processing system %x% %m% of %ends%",ends,0) c=FileFullName(x) srvnm=FileMapName(x,"*") srvcs=IniItemizePvt("SERVICE", c ) sv=itemcount(srvcs,@tab) srvcs_fn="" for s= 1 to sv scntrl=1 svps=itemextract(s,srvcs,@tab) svc_var=IniReadPvt("SERVICE",svps, "", c ) if svc_var==0 Gosub file break endif next next :SRV_OFF For n = 1 to num_off astatusbar(1,"Monitor Report","Processing system %x% %m% of %ends%",ends,0) mnt=0 x=itemextract(n,srvscnt_off,@tab) c=FileFullName(x) srvnm=FileMapName(x,"*") Gosub file next astatusbar(2,"Monitor Report","Report complete",ends,0) message("ReportLocation","The report is located at: %ini_log%") fileclose(f) run("notepad",ini_log) return :FILE if mnt==1 mnt="ON" else mnt="OFF" endif SrvNm=IniReadPvt("NAME","Srv", "", c ) filewrite(f,"===> %srvnm% monitoring is %mnt% ") srvcs=IniItemizePvt("SERVICE", c ) sv=itemcount(srvcs,@tab) srvcs_fn="" for s= 1 to sv scntrl=1 svps=itemextract(s,srvcs,@tab) svc_var=IniReadPvt("SERVICE",svps, "", c ) if svc_var==0 then filewrite(f," SERVICE-> %svps% Not Monitored" ) next filewrite(f,"" ) return :INI_UP gosub deffunc ; define functions ;if param0 <> 2 param1 = "Ini file modification" param2 = file;AskFileName(param1, "", "ini files|*.*", "", 1) ;endif MyTitle = StrCat(param1, " (", param2, ")") ; -------------------------------------------------------------------- Localtmp = Environment("TEMP") if Localtmp == "" then Localtmp = "c:\temp" If DirExist(localtmp) == @false Then DirMake(localtmp) mydmp = StrCat(Localtmp, "\modifini.dmp") if fileexist(mydmp) then filedelete(mydmp) ; -------------------------------------------------------------------- Intcontrol(73, 2, 0, 0, 0) debugtrace(2, mydmp) AddExtender("wilx44i.dll") mbstop = xHex(10) mbquestion = xHex(20) mbexclaim = xHex(30) mbinfo = xHex(40) idyes = xHex(6) idno = xHex(7) theini = param2 nbp = 0 Allsec = IniItemizePvt("", theini) for ii = 1 to ItemCount(allsec, @tab) sect = ItemExtract(ii, allsec, @tab) psect = IniItemIzePvt(sect, theini) nbp = nbp + ItemCount(psect, @tab) next ind = 0 If nbp == 0 Message(Mytitle, "No parameters to be edited") exit endif ArrTree = ArrDimension(nbp + ii - 1) for ii = 1 to ItemCount(allsec, @tab) sect = ItemExtract(ii, allsec, @tab) psect = IniItemIzePvt(sect, theini) ArrTree[ind] = StrCat("+", sect) ind = ind + 1 for jj = 1 to ItemCount(psect, @tab) par = ItemExtract(jj, psect, @tab) ArrTree[ind] = StrCat(" ", par) ind = ind + 1 next next IntControl (49, 1, 5, 0, 0) IntControl (33, 0, 0, 0, 0) treeFormat=`WWWDLGED,6.1` modvalue = @false treeCaption = '%vers% - ini editor' treeX=131 treeY=147 treeWidth=350 treeHeight=260 treeNumControls=005 treeProcedure=`TimerProc` treeFont=`DEFAULT` treeTextColor=`DEFAULT` treeBackground=`DEFAULT,DEFAULT` outini = LoadIni(Theini) while @true Thelist = BuildTree(ArrTree) tree001 = `149,240,036,012,PUSHBUTTON,DEFAULT,"Close",1,1,DEFAULT,DEFAULT,DEFAULT,DEFAULT` tree002 = `003,021,144,218,ITEMBOX,Thelist,DEFAULT,DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT` tree003 = `153,021,190,020,EDITBOX,MyVariable2,"",DEFAULT,4,8,DEFAULT,DEFAULT,DEFAULT` tree004 = `153,050,036,012,PUSHBUTTON,DEFAULT,"Apply",2,5,2,DEFAULT,DEFAULT,DEFAULT` tree005 = `153,080,190,152,MULTILINEBOX ,outini,"xxxxx",DEFAULT,4,8,DEFAULT,DEFAULT,DEFAULT`;"219|219|219"` ButtonPushed=Dialog("tree") if buttonpushed == 1 then break endwhile return :WBERRORHANDLER lasterr = Lasterror() intcontrol(1000, lasterr, 0, 0, 0) errmess = StrCat(lasterr, ":", intcontrol(34, lasterr, 0, 0, 0)) xMessage = StrCat("Internal Error : ", errmess, @crlf, wberrorhandlerline, @crlf, wberrorhandleroffset, @crlf, wberrorhandlerassignment) if isdefined(mydmp) if !Fileexist(mydmp) debugtrace(1, mydmp) IntControl (71, 3, 1, 0, 0) debugtrace(0, mydmp) endif if Fileexist(mydmp) xMessage = StrCat(xmessage, @crlf, "Please, send this file : %mydmp%", @crlf, "to : chuck@arconi.com") endif endif Message (MyTitle, xMessage) dllfree(user32) exit ; functions definition .................................................................................................................... :deffunc #defineFunction BuildTree(arrtree) outlist = "" index = -1 expand = @false nbi = ArrInfo(arrtree, 1) for i = 1 to nbi index = index + 1 val = arrtree[index] if StrSub(val, 1, 1) == " " if expand OutList = ItemInsert(StrCat(" ", val), -1, outlist, @tab) endif continue endif if StrSub(val, 1, 1) == "+" expand = @false else expand = @true endif OutList = ItemInsert(val, -1, outlist, @tab) next return outlist #endfunction #defineFunction UpdTree(arrtree, item, Myini) nbi = ArrInfo(arrtree, 1) disp = "??????" if StrIndex(item, @tab, 1, @fwdscan) <> 0 then item = StrTrim(strsub(item, 1, pos - 1)) for i = 0 to nbi - 1 SrcItem = StrTRim(arrtree[i]) If StrSub(srcitem, 1, 1) == "-" then thesect = StrSub(srcitem, 2, -1) if SrcItem == StrTrim(item) if StrSub(item, 1, 1) == "+" arrtree[i] = StrCat("-", StrSub(item, 2, -1)) disp = arrtree[i] else if StrSub(item, 1, 1) == "-" arrtree[i] = StrCat("+", StrSub(item, 2, -1)) disp = arrtree[i] else if !Isdefined(thesect) then continue Value = StrReplace(IniReadPvt(thesect, StrTrim(item), " ", Myini), @tab, " ") ; display(2, "test", In) disp = StrCat(value, @tab, i) endif endif break endif next return disp #endfunction #defineFunction UpdIni(arrtree, indexI, Myini, value) key = StrTRim(arrtree[indexI]) for i = indexi to 0 by -1 SrcItem = StrTRim(arrtree[i]) If StrSub(srcitem, 1, 1) == "-" thesect = StrSub(srcitem, 2, -1) break endif next IniWritePvt(thesect, key, value, MyIni) return #endfunction #defineFunction LoadIni(Myini) OutIni = "" hd = FileOpen(MyIni, "read") while @true rec = FileRead(hd) if rec == "*EOF*" then break rec = StrReplace(rec, @tab, " ") OutIni = ItemInsert(rec, - 1, outini, @tab) endwhile fileclose(hd) return STrReplace(OutIni, @tab, @crlf) #endfunction #DEFINESUBROUTINE TimerProc(Handle,dMessage,ControlID,param4,param5) InitDialog = 0 TimerTick = 1 switch dMessage case InitDialog user32=dllload(strcat(dirwindows(1),"user32.dll")) LB_SETCURSEL=390 LB_GETCURSEL=392 ;get lb handle hw_lb=dllcall(user32,long:"GetDlgItem",long:Handle,long:99+002) DialogProcOptions(Handle, 7, 1); Pass item listbox selection changes. DialogProcOptions(Handle, 5, 1); Value change in editbox DialogProcOptions(Handle, 2, 1); Push Button DialogProcOptions(Handle, 11, 1); X window return (-1) case TimerTick return(-1) case 7 if modvalue newvalue = DialogControlGet(Handle, 3, 3); Set text rc = xMessageBox(MyTitle, "Save value ?", @MBYESNO | mbquestion) if rc == idyes updIni (arrtree, indexi, Theini, newvalue) outini = LoadIni(Theini) DialogControlSet(Handle, 5, 3, outini); Set text endif modvalue = @false endif sSelection = DialogControlGet(Handle, ControlID, 6); Get selection selIndex=dllcall(user32,long:"SendMessageA",long:hw_lb,long:LB_GETCURSEL,long:0,long:0) dispText = Updtree(arrtree, sSelection, Theini) if strsub(sSelection, 1, 1) == " " indexI = ItemExtract(2, disptext, @tab) disptext = ItemExtract(1, disptext, @tab) endif Thelist = BuildTree(ArrTree) DialogControlSet(Handle, 3, 3, dispText); Set text DialogControlSet(Handle, 2, 5, Thelist); Set text if StrSub(sSelection, 1, 1) <> " " ;DialogControlSet(Handle, 2, 6, dispText); Set selection dllcall(user32,long:"SendMessageA",long:hw_lb,long:LB_SETCURSEL,long:selIndex,long:0) DialogControlState(Handle, 3, 3, 8); remove read only else DialogControlState(Handle, 3, 4, 8); set read only ;DialogControlSet(Handle, 2, 6, sSelection); Set selection dllcall(user32,long:"SendMessageA",long:hw_lb,long:LB_SETCURSEL,long:selIndex,long:0) endif break; case 5 modvalue = @true DialogControlState(Handle, 4, 4, 2); remove disabled break case 11 exit case 2 rc = idno if ControlID == 1 && modvalue rc = xMessageBox(MyTitle, "Save value ?", @MBYESNO | mbquestion) endif if ControlID == 4 || rc == idyes newvalue = DialogControlGet(Handle, 3, 3); Set text updIni (arrtree, indexi, Theini, newvalue) outini = LoadIni(Theini) DialogControlSet(Handle, 5, 3, outini); Set text modvalue = @false DialogControlState(Handle, 4, 3, 2); set disabled endif break DialogControlState(Handle, 4, 3, 2); set disabled endswitch ; ntlMessage Return(-1) ; Do default processing #ENDSUBROUTINE return