Hello. I have one zabbix-agent in the same host of zabbix-server.
I defined this key:
UserParameter=ntpoff,/tmp/ntp_offset.sh
ntp_offset.sh script is very simple:
1) write in log date start
2) launch ntpq and extract offset. Save offset in variable
3 print to stdout offset and write to log file.
3) write in log date stop
I launched tail -f log zabbix-server and ntp_offset.sh script and obtain:
Randomly, I don't find why zabbix-agent don't launch script.
I have this item and also fail:
UserParameter=ntpnum,/usr/sbin/ntpq -p | grep -c "^*"
However, this work perfectly:
UserParameter=site,echo cadena_string
I don't understand it. I have seven host, same problems in all.
Somebody has any ideas?
Thanks
I defined this key:
UserParameter=ntpoff,/tmp/ntp_offset.sh
ntp_offset.sh script is very simple:
1) write in log date start
2) launch ntpq and extract offset. Save offset in variable
3 print to stdout offset and write to log file.
3) write in log date stop
I launched tail -f log zabbix-server and ntp_offset.sh script and obtain:
mar dic 10 20:38:14 CET 2013 Iniciando...
mar dic 10 20:38:14 CET 2013 VALOR: -23.366-
mar dic 10 20:38:14 CET 2013 Fin
mar dic 10 20:39:14 CET 2013 Iniciando...
mar dic 10 20:39:14 CET 2013 VALOR: -23.366-
mar dic 10 20:39:14 CET 2013 Fin
mar dic 10 20:40:14 CET 2013 Iniciando...
mar dic 10 20:40:14 CET 2013 VALOR: -23.366-
mar dic 10 20:40:14 CET 2013 Fin
mar dic 10 20:41:14 CET 2013 Iniciando...
2154:20131210:204119.306 item [zabbixs.xxxx:ntpoff] became not supported: Not supported by Zabbix Agent
mar dic 10 20:45:14 CET 2013 Iniciando...
mar dic 10 20:45:15 CET 2013 VALOR: -23.366-
mar dic 10 20:45:15 CET 2013 Fin
2155:20131210:204517.067 item [zabbixs.xxxx:ntpoff] became supported
mar dic 10 20:46:14 CET 2013 Iniciando...
mar dic 10 20:46:14 CET 2013 VALOR: -23.366-
mar dic 10 20:46:14 CET 2013 Fin
mar dic 10 20:47:14 CET 2013 Iniciando...
mar dic 10 20:47:14 CET 2013 VALOR: -23.366-
mar dic 10 20:47:14 CET 2013 Fin
mar dic 10 20:48:14 CET 2013 Iniciando...
mar dic 10 20:48:14 CET 2013 VALOR: -22.746-
mar dic 10 20:48:14 CET 2013 Fin
mar dic 10 20:38:14 CET 2013 VALOR: -23.366-
mar dic 10 20:38:14 CET 2013 Fin
mar dic 10 20:39:14 CET 2013 Iniciando...
mar dic 10 20:39:14 CET 2013 VALOR: -23.366-
mar dic 10 20:39:14 CET 2013 Fin
mar dic 10 20:40:14 CET 2013 Iniciando...
mar dic 10 20:40:14 CET 2013 VALOR: -23.366-
mar dic 10 20:40:14 CET 2013 Fin
mar dic 10 20:41:14 CET 2013 Iniciando...
2154:20131210:204119.306 item [zabbixs.xxxx:ntpoff] became not supported: Not supported by Zabbix Agent
mar dic 10 20:45:14 CET 2013 Iniciando...
mar dic 10 20:45:15 CET 2013 VALOR: -23.366-
mar dic 10 20:45:15 CET 2013 Fin
2155:20131210:204517.067 item [zabbixs.xxxx:ntpoff] became supported
mar dic 10 20:46:14 CET 2013 Iniciando...
mar dic 10 20:46:14 CET 2013 VALOR: -23.366-
mar dic 10 20:46:14 CET 2013 Fin
mar dic 10 20:47:14 CET 2013 Iniciando...
mar dic 10 20:47:14 CET 2013 VALOR: -23.366-
mar dic 10 20:47:14 CET 2013 Fin
mar dic 10 20:48:14 CET 2013 Iniciando...
mar dic 10 20:48:14 CET 2013 VALOR: -22.746-
mar dic 10 20:48:14 CET 2013 Fin
Randomly, I don't find why zabbix-agent don't launch script.
I have this item and also fail:
UserParameter=ntpnum,/usr/sbin/ntpq -p | grep -c "^*"
However, this work perfectly:
UserParameter=site,echo cadena_string
I don't understand it. I have seven host, same problems in all.
Somebody has any ideas?
Thanks
Comment