Client Management Suite

 View Only
Expand all | Collapse all

VBS "Health-Check" Client script

Migration User

Migration UserJun 13, 2012 09:33 AM

  • 1.  VBS "Health-Check" Client script

    Posted Jun 01, 2012 02:45 PM

    I'm pretty new to the Altiris system,  and I've checked Forum...  is there a vbs script to check the health of a 7.1 client system?    

    What I mean by "health-check"  is a script for the Windows client that

    1. verifies that Management Agent and PcAnywhere Host server is running
    2. the correct accounts is in the local Admin groups
    3. Its running the correct version (7.1) and pointing to the correct server.
    4. Checks the last configuration request date.
    5. Anything else I'm missing?

    Ideally it would install the client if the conditions weren't met.    

     

     



  • 2.  RE: VBS "Health-Check" Client script

    Posted Jun 02, 2012 03:04 AM

    heres your service code

    i think the status codes are:

    1 = stopped
    2 = start pending
    3 = stop pending
    4 = running
    5 = continue_poending
    6 = pause_pending
    7 = paused
    8 = error
     

    Set objComputer = GetObject("WinNT://computername,computer")
    objComputer.Filter = Array("Service")
    
    strServiceName = "blaablaa"
    
    For Each aService In objComputer
    If LCase(strServiceName) = LCase(aService.Name) Then
    Wscript.Echo aService.Name & "=" & aService.Status
    End If
    Next
    

    use CACLS, XCACLS or ICACLS to do a the file perm scan

     

     



  • 3.  RE: VBS "Health-Check" Client script

    Posted Jun 03, 2012 11:57 AM

    Hi shareefAtwork,

    Do you need this vbs script to input in a login script?

    Item 02: Would you like to correct the group membership?

    Item 03: What you would like to do If you find an older version (like 6.x)?

    Item 04: What you would like to do with the last configuration request date? Compare with the current date and take some action?

    Regards,

    Fabio Sanches



  • 4.  RE: VBS "Health-Check" Client script

    Posted Jun 04, 2012 06:04 PM

    Hello

    Right now, I'm not looking to perform any action/remediation,  I want to report back on the information.  I'm writting the information to a database and text file. 

     

    In the future it would be nice to remediate.   I'm sure I'll use a log-in script.   

    I should be able to write the group membership part of it.   If you have something already done that would be nice.  :)  

     

     

    Shareef

     

     



  • 5.  RE: VBS "Health-Check" Client script

    Posted Jun 05, 2012 08:49 PM
      |   view attached

    I just came across this script while wrapping some things up before vacation.  I'm not sure of the source.  But perhaps it will meet your need!

    Attachment(s)



  • 6.  RE: VBS "Health-Check" Client script

    Posted Jun 06, 2012 03:51 AM

    If you're looking to do this at logon what i would suggest if you are keeping it a database or text file is to put it in to a custom inventory in Altiris

    Basically you could create the custom inventory and the relevant custom inventory fields that would be able to hold the returned data using a VBS, CMD, WMI script

    That way you dont need to create external text files or databases it can be tied in to your computer data.

    i would definately recommend ensuring you have a time date field added in to the script so you know when the data was last added.

    Below i've linked some samples and the howto documents. the samples are really useful with examples of scanning with WMI and getting device details.

    https://www-secure.symantec.com/connect/articles/how-programmatically-create-custom-inventory-nsi-file

    http://www.symantec.com/docs/HOWTO10487 - Introduction to Custom Inventories

    http://www.symantec.com/business/support/index?page=content&id=HOWTO9148 - Samples of custom inventories

    Hope this helps

     



  • 7.  RE: VBS "Health-Check" Client script

    Posted Jun 06, 2012 09:11 AM

    Pretty neat script, except that if I'm reading it right - the first thing it does is check for the 7.1 agent.  If it finds that agent, the script ends and none of the other checks run.



  • 8.  RE: VBS "Health-Check" Client script

    Posted Jun 06, 2012 09:12 AM

    I see a problem with using Altiris to determine if Altiris is healthy...



  • 9.  RE: VBS "Health-Check" Client script

    Posted Jun 06, 2012 10:29 AM

    At least half of this point is worth looking at.

    If the agent is NOT healthy, then it'll have a hard time posting up custom inventory, right?  True, custom inventory is the ideal place to store information for future reporting, but the ability to automatically create that NSE is dependent on a healthy agent.  Sorta defeats the purpose.

    Then again, using Altiris to store the data is NOT necessarily a bad idea because we're not checking the health of the server, but of the clients - fundamentally different devices and different types of health.

     



  • 10.  RE: VBS "Health-Check" Client script

    Posted Jun 06, 2012 01:28 PM

    Bugger!
    I forgot the script needs the agent to hand off the event.

     



  • 11.  RE: VBS "Health-Check" Client script

    Posted Jun 06, 2012 01:50 PM

    I was thinking it may be worth a look in to a remote agentless inventory script. You could possibly use agentless inventory mixed with the VBS / CMD Scripts that ran at logon dumping the data to a set of registry keys or flat files and do a WMI check on a registry or file search (http://blogs.technet.com/b/heyscriptingguy/archive/2004/10/29/how-can-i-tell-whether-a-value-exists-in-the-registry.aspx).

    To be honest though, i would just run the VBS scripts you're looking at and then at the end upload the file to a server share and process it. I would have a scheduled task that does a check on a folder on a central server and then imports the data in to a database table. you could do a cleanup script on the files you're uploading. if you prefix the filenames with the computer name hyphen data name (TESTMACHINE-AGENTCHECK.txt) or whatever and then you can put them in to fields after you've cleaned up the import data.

    BUT! that would be heavily over engineering the situation.

    To get around the right groups on machines we run an inventory report and find out which don't have the groups in the machines. I beleive you could run a report to check when the machines last registered in.

    You can get from that information also if you have deployed 300 devices and you are only getting 250 inventories back that there potentially is a fault with 50 devices and run a report on that also.

    Infact you could setup automation policies to email you the results of the reports as well.

    Are there that many device / agents failing? We've had a few issues with agents at our company but honestly its far fewer than i expected and alot of the failing agents i saw in the event logs on our NS Server telling me it couldnt communicate, run policies or respond.

    just thoughts from the top of my head.

    Regards



  • 12.  RE: VBS "Health-Check" Client script

    Posted Jun 11, 2012 07:01 PM

    I'm going to take a look at the scripts posted sometime this week and add them to the script I'm creating.        Right now I'm looking at the Agent version version and checking the "Policy Last Received" in the registry.   

    Thank you all, for your help! 



  • 13.  RE: VBS "Health-Check" Client script

    Posted Jun 11, 2012 07:14 PM

     

    In case you are intrested this is how I'm doing it..
     
    Right now the script is checking for other stuff and it has work information in it,  so I'm just posting a snippit of the Altiris piece.   The varibles created in the script get are inserted into a custom database.       This won't run as is,   but it might be enough for someone else looking to do the same thing. Its pretty basic right now.    I'm also checking for Admin$.     
     
     
     
     
    If objFSO.FileExists("C:\Program Files\Altiris\Altiris Agent\AeXNSAgent.exe") Then
    AltirisAgent = objFSO.GetFileVersion("C:\Program Files\Altiris\Altiris Agent\AeXNSAgent.exe")
    AltirisNSServer = WShell.RegRead ("HKLM\SOFTWARE\Altiris\eXpress\NS Client\DefaultServer")
    'msgbox AltirisNSServer
    Else
    'MsgBox "NA"
    AltirisNSServer = "NA"
    AltirisAgent = "NA"
    End If
    If AltirisNSServer <> "NA" Then
    LastAltInv = WShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Altiris\Altiris Agent\Servers\" & AltirisNSServer & "\" & "Policy Last Received")
    LastBasicAltInv = left(LastAltInv, 19)
    'MsgBox LastBasicAltInv
    Else
    End If 


  • 14.  RE: VBS "Health-Check" Client script

    Posted Jun 12, 2012 02:44 PM
      |   view attached

    One thing that might be helpful in identifying "health" is to use the CRT Reports and tools. They provide a lot of decent reports that help identify problem agents with basic inventory missing, regular inventory missing, missing agents etc. It might be a good starting point instead of trying to script a solution.

    Then if you really need to, use RAAD to diagnose those targets with issues directly.

    I think the CRT Tools had to be requested when I worked with my RPS, I forget exactly where I got them but could export my report folder and post if you want. Maybe Thomas could point out the actual dl location/source.

    I attached a screenshot for reference. 



  • 15.  RE: VBS "Health-Check" Client script

    Posted Jun 13, 2012 03:04 AM

    Those reports look very useful. I definitely would be interested in a copy of them if possible.

    Regards
    Jim 



  • 16.  RE: VBS "Health-Check" Client script

    Posted Jun 13, 2012 08:56 AM

    I exported the entire CRT Reports folder and created a download article for it. Once approved and published you can save the .zip file, extract the .XML and import it into your Reports menu.



  • 17.  RE: VBS "Health-Check" Client script

    Posted Jun 13, 2012 09:33 AM

    Thanks alot that's really helpful :)