Well that's pretty simple :smileywink:
1) First, did you manually verify the script functions 100% with the results you are expecting using the service account you created?
2) Assuming #1 was properly tested, create a configuration file, you can call it anything or .visdkrc as you named it.
The file can contain various variables that include:
VI_SERVER=<esx or esxi or vcenter hostname>
VI_USERNAME=<esx or esxi or vcenter username>
VI_PASSWORD=<password>
VI_PROTOCOL=<http or https>
Say you have a script called "check_esx.pl", you would create a cron entry and it should have the following assuming you've populated everything correctly:
check_esx.pl --config .visdkrc
This uses the --config flag and reads in the file and based on the populated file, it'll use those as the credentials. Note, you don't need to fill in every single variable. If you want to loop through a set of ESX(i) host, you probably want to leave VI_SERVER out and just specify that on the command line useing --server and the username and password maybe the same.
Hopefully this makes sense.
=========================================================================
William Lam
VMware vExpert 2009,2010
VMware VCP3,4
VMware VCAP4-DCA
VMware scripts and resources at:
Twitter: @lamw
Getting Started with the vMA (tips/tricks)
Getting Started with the vSphere SDK for Perl
VMware Code Central - Scripts/Sample code for Developers and Administrators
VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".