Create a server property called "PROGRAMFILES" and set the values up like "/C/Program Files" and "/C/Program Files (x86)"
Create a component template w/ the part of "??TARGET.PROGRAMFILES??/common files/symantec shared/virusdefs/definfo.dat". use this part as a discovery condition.
then run your snapshot and audit jobs using this template and the associated components.
you can use that parameterized path in the config file definition too...
I'm not sure about cutting off the version, you'd have to have a different grammar file that could handle the delimiters of = and .
or you could write an extended object like:
cat //??TARGET.HOST??"??TARGET.PROGRAMFILES??/common files/symantec shared/virusdefs/definfo.dat | grep NAME= | cut -f1 -d.
might need to play w/ that a bit.
Thanks Bill... I was thinking that variables would be the way to go - problem is, the BladeLogic documentation is a little "lacking"... But this sounds like it will work!
QUESTION: This property will be something that will will need to be defined for each Wintel server, correct? Or will this be something that will automatically deduce? ("oh, it's a 32bit -> /c/Program\ Files\.... or 64bit -> /c/Program\ Files\ (x86)\ or... It's not a wintel box at all -> <empty>")
Also, the CAT command is great, too! I'll play around with it.
Your suggestion for using a variable in my configuration object was perfect. It audits both 32- & 64-bit servers in one audit with no issue - thanks.
Now, trying to get an EO going here but i'm having trouble.
I've got the NSH command that will run in a putty session that will parse out the info I need from the DEFINFO.DAT file on 32-bit servers:
cat //<servername>/c/Program\ Files/common\ files/symantec\ shared/virusdefs/definfo.dat | grep CurDefs= | cut -c 9-16
and for 64-bit:
cat //<servername>/c/Program\ Files\ (x86)/common\ files/symantec\ shared/virusdefs/definfo.dat | grep CurDefs= | cut -c 9-16
Now, I am trying to remember what I learned about EO's and I just can't seem to get it right.
I've played around with it a little and got this to work:
Problem with this is, it won't take advantage of my ??TARGET.PROGRAMFILES?? variable (which is set to /C/Program Files, /C/Program Files (x86) or \) - I can't believe that I have to use "Progra~1" - there has to be a way that this one command will work on both windows platforms...
Second problem is, it konks out when i throw a "|" at the end (for example: "| grep CurDefs=")
Is there a way I can utilize my TARGET.PROGRAMFILES variable in the above EO?
Second, how can I implement the "grep" and "cut" that I'll need to extract just the info that I need?
Third, in going thru other EO's, i saw commands that were prefaced with "nsh -c" and "nexec" - will I need any of those to make this work my way?
use double quotes like:
cat "//??TARGET.HOST????TARGET.PROGRAMFILES??/common files/symantec shared/virusdefs/definfo.dat" | grep CurDefs= | cut -c 9-16
to deal w/ the pipe, you might need to do something like:
nsh -c "
cat \"//??TARGET.HOST????TARGET.PROGRAMFILES??/common files/symantec shared/virusdefs/definfo.dat\" | grep CurDefs= | cut -c 9-16"
Ok, this is still not working for me. I've created a vbscript that will
find the info that I am looking for, while also compensating the change in platforms:
Set WshShell = CreateObject("WScript.Shell")
OsType = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")
If OsType = "x86" then
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("c:\Program Files" & PathSuffix & "\Common Files\Symantec Shared\VirusDefs\DefInfo.Dat", ForReading)
strContents = objFile.ReadAll
What the whole text file looks like:
what gets pulled out in the DefDate variable:
Now, my question is (since I am new to this), how do I get the DefDate value sent back to the extended object?
This is getting too confusing... I'm not even certain on how to use NEXEC to execute this script (whether it's located on the AppServer or locally on the target server)....
You need to get your output to cut off the .blah. When that comes into BladeLogic, the grammar engine will parse it and it doesn't know what to do w/ something you want to delimit first by '=', then by '.'
You should be able to use either name=value or ini as the grammar.