Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Thu Apr 18, 2024 5:50 pm

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
PostPosted: Mon Oct 05, 2009 1:15 am 
Offline
Contributor

Joined: Fri Jul 04, 2008 6:46 am
Posts: 153
Location: USA - WI
I've worked on an addition to audit.vbs so that it accepts named arguments. The only audit.config parameters it doesn't accept from the command line are the email ones. I can always add them...I just wasn't sure if it was worth it. I also added an option to specify an audit.config from the command line, which seems to satisfy a fixme in the script.

I added it in such a way that it shouldn't interfere with how the script previously worked. All previous ways the script was used should still work as expected. However, I did notice that there was support for unnamed arguments in the script. Given the logic of the script, I'm not sure if they ever worked or what the intention was with them. It looks like maybe it was meant so that you could override the strComputer, strUser, and strPass so long as you still had an audit.config available. In any case, I left the support in for those unnamed arguments as well.

A few advantages to this ...


  • You can use several different audit.configs without needing to hardcode config paths in the script or use multiple audit.vbs files.

  • You can use command line arguments only if you want to, no audit.config neccessary.

  • You can use a single audit.config but override certain parts with command line arguments if you want.


One odd thing I noticed is that the script defines that the logic should be this...

[code]
' look for audit.config and use that, if it doesn't exist, grab it from
' the web server, if we cant do that, then use the internal defaults.
' Finally modify the defaults depending on any command line switches
[/code]

However, currently, if the script cannot grab the audit.config from the server the script just fails. The main reason this happens is because a default is set at the top of the script that defines the URL for where to get the script. Should it just check if a URL is set (it only seems to be set if you would launch it from the web interface), and if it isn't set and no config is set and it isn't set to only use command line arguments, then set some defaults?

Any objections to this or the approach I'm using? I've attached the patch and file if someone wants to give it a try. The main way to use it with named arguments is to just do 'cscript audit.vbs /strComputer:." and so on for each audit.config entry. You can run 'cscript audit.vbs /help' for usage information.


Attachments:
audit.vbs-named_args.zip [41.8 KiB]
Downloaded 412 times

_________________
OA Server: Debian Squeeze w/ Apache2
Auditing: 700 Workstations, 250 or so Retail Terminals, about 75 Servers
OS's: Windows XP/2003/2008/2008 R2/Vista/7, Debian
LDAP: Active Directory 2008 R2
Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 10, 2009 2:07 am 
Offline
Contributor

Joined: Fri Jul 04, 2008 6:46 am
Posts: 153
Location: USA - WI
Added these changes to SVN, rev 1198.

_________________
OA Server: Debian Squeeze w/ Apache2
Auditing: 700 Workstations, 250 or so Retail Terminals, about 75 Servers
OS's: Windows XP/2003/2008/2008 R2/Vista/7, Debian
LDAP: Active Directory 2008 R2


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group