Running a Qualys Connector manually succeeds, but when I try to automate it using cron, I receive the following error:
Can't locate SFCheckPreReq.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at <path to connector>/qualys_connector.pl line 8.
BEGIN failed--compilation aborted at <path to connector>/qualys_connector.pl line 8.
The <path to connector> in the above output is the location where I have installed the connector.
There is one special concern, when running the Qualys Connector via cron, rather than directly. Specifically, the Qualys Connector script has several libraries in a sub-directory, that it requires. When you run it by hand, these sub-directories are relative to the current directory (known as . and is the last entry in the @INC path). When run from cron, however, that is not the current directory.
There is a simple solution, prepend a cd <path to connector> command to the cron entry. For instance, assume: