Cron jobs do not run with the bashrc profile loaded. AMP relies on the .bashrc file to initiate many environment variables and provide aliased functions. Without these variables or aliases, cron entries can fail to run if you try to use something that is not defined.
You can initialize the bashrc profile inside a cron job. To do this, follow the format below:
* * * * * /bin/bash -c '. /root/.bashrc && <CMD>'
A common problem with cron is not having aliased commands such as "s2w". Also, the SNMP MIBs can not be translated in a cron job because the environment variables for the MIBs directory hasn't been initialized. By referencing the bashrc profile, these problems go away. The following cron entry would poll a controller for a specific OID every 1 minute. It saves the results to a /tmp file and each poll is preceded with the timestamp of when the command ran.
* * * * * /bin/bash -c '. /root/.bashrc && (date && s2w 10.162.108.3 public wlanAPChUtilization -OX) >> /tmp/ap_ch_data.txt'