1.0

Table Of Contents
www.vmware.com
254
VMware ACE Administrator’s Manual
env_var = getenv("TEST_DEVICE");
if ((env_var == NULL) || (strlen(env_var) == 0)) {
printf("NO");
} else {
printf("YES");
}
return 0;
}
Sample Network Quarantine Script 1
The following sample script is written in C. It is installed by VMware ACE Manager as
sampleQuarantine.c. sYou may compile it with a C compiler if you want to run
it.
/*
* VMware Sample Script
*
* This is a sample network quarantine script for VMware ACE.
*
* Notes About this sample:
* The NQ Script does 2 things, (1) verifies that the string in
* VMWARE_NQ_DESCRIPTOR is valid, and (2) returns whether the
* guest operating system that this descriptor is from should be
* given normal access (YES), or should be given restricted
* access (NO)
*
* For testing purposes a list of NQ_DESCRIPTORS is stored
* statically in this file, each with its corresponding result
* (YES/NO/REJECT); this sample script will match the value in
* VMWARE_NQ_DESCRIPTOR to a stored string and output its stored
* "up-to-date" state (YES/NO/REJECT).
* If there are no matches, then we output REJECT.
*
* Input to script:
* Script examines the environment variable VMWARE_NQ_DESCRIPTOR
*
* Returns:
* Returns 0 for success
*
* Expected output:
* The script may output to stdout:
* 'YES' - the descriptor is valid and up-to-date
* 'NO' - the descriptor is valid and not up-to-date
* 'REJECT' - the descriptor is not valid