omni-lchen / zabbix-cloudwatch

71 stars 61 forks source link

cron job doesn't work #41

Closed ghost closed 5 years ago

ghost commented 5 years ago

when executed cron.Service.sh -parameers, it works fine-data sent to zabbix,but from cron job nothing happens

i tried crontab -e

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/opt/zabbix/cloudwatch/zabbix-cloudwatch/cron.d

*/1 * * * * root /opt/zabbix/cloudwatch/zabbix-cloudwatch/cron.d/cron.Lambda.sh "lambda-cllean-unknown-instances" "aws_north_virginia" "localhost" "default" "us-east-1" >/tmp/2.txt

file 2.txt is created but it's empty

file is not even created if specified in crontab file

ghost commented 5 years ago

started working on following way (removed root);

crontab -e

*/1 * * * * /opt/zabbix/cloudwatch/zabbix-cloudwatch/cron.d/cron.Lambda.sh "lambda-cllean-unknown-instances" "aws_north_virginia" "localhost" "default" "us-east-1"