Novell Home

Antivirus Definition Update Script

Novell Cool Solutions: Trench
By Roger Fenner

Digg This - Slashdot This

Posted: 12 Feb 2003
 

We are a NetWare 5.1/6 shop running ZEN 3.2. We currently update virus definition files by downloading the update, copying it to the distribution directory, and having a ZEN application push it out based on the version number being updated.

After scouring websites for a way to automate this, I found nothing. So, I wrote an NSN script to do it. It's a very quick and dirty script, but it works. I'm submitting a generic version for everyone to use. It should be pretty self-explanatory.

Hope this helps!

Script

This script is used to FTP the latest virus definition file from a software provider. It then copies the file to the distribution directory on another server and then increments the version number for the ZEN application object.

'Get a file from remote host
set virussoftwareproviderFTP = createobject ("ucx:ftpfilemgr")
' Create FTP Manager Object
virussoftwareproviderFTP.server = "ftp.virussoftwareprovider.com"
' Define FTP Server
virussoftwareproviderFTP.login ("anonymous", "admin@yourcompany.com")
' Perform anonymous login
virussoftwareproviderFTP.BinMode = True
' Set FTP for binary transfer
virussoftwareproviderFTP.ChangeLocalDir("volume:LocalPathToFile")
' change local directory
virussoftwareproviderFTP.ChangeDir
("public/english_us_canada/antivirus_definitions/norton_antivirus/static")
' change remote directory
set virussoftwareproviderDir = virussoftwareproviderFTP.currentDir
' Create current directory object
set entries = SymantecDir.getchildren()
' Get child entries of current directory
entries.Get ("symcdefsx86.exe","navdefup.exe")
' Perform FTP GET on file and save
as a different filename
virussoftwareproviderFTP.logout()
' Logout of FTP server
' Authenticate to Tree
Set nwdir=CreateObject ("UCX:NWDIR")
' Create DS object
if (nwdir.login (".NAVUpdateUser.YourOrganizaion.YourTreeName",
"password")) Then
' Login and check for success

' Copy file
Set FSO = CreateObject("Scripting.FileSystemObject")
' create file system object

FSO.CopyFile("\\SRCSERV\volume:pathtofile\navdefup.exe","
\\DESTSERV\volume:pathtodistributionpoint\",TRUE)
' Copy file to final destination, set overwrite flag to true
' Update version number in Application object
Set AVApp=nwdir.FindEntry("NDS:\\YourTreeName\DSPathToObject\ZEN
Antivirus Definition Update Object") ' Get the Zen object for the
definition push
AVAppVer=avApp.GetFieldValue("zenappDisconnectedVersionNumber")
' Get the version number
UpAVAppVer=AVAppVer+1
' Increment the value
AVApp.SetFieldvalue("zenappDisconnectedVersionNumber",UpNAVAppVer)
' Set version number in object
to incremented value
AVApp.Update()
' Update the object
endif
' End check for success
' Logout
nwdi

Roger is a Sr. Systems Engineer at Comair, Inc. If you have any questions you may contact him at rpfenner@myrealbox.com


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell