I have the following line in my crontab.
* * * * * root /usr/bin/zabbix_sender -z server.fqdn.com -s 'hostname' -k 'postgres.replication.lag' -o `/var/lib/postgresql/pg_standby_lag.rb` -vv
This works but it sends weird values to zabbix. If run the command line from a shell it sends the value as output from pb_standby_lag.rb which is a positive integer (number of seconds).
If I call the exact same line from cron the data comes in as a negative number.
I can trace the number that comes in from the zabbix log so I know when the right and wrong number are sent.
Why is the exact same script sending a different value from cron?
* * * * * root /usr/bin/zabbix_sender -z server.fqdn.com -s 'hostname' -k 'postgres.replication.lag' -o `/var/lib/postgresql/pg_standby_lag.rb` -vv
This works but it sends weird values to zabbix. If run the command line from a shell it sends the value as output from pb_standby_lag.rb which is a positive integer (number of seconds).
If I call the exact same line from cron the data comes in as a negative number.
I can trace the number that comes in from the zabbix log so I know when the right and wrong number are sent.
Why is the exact same script sending a different value from cron?
Comment