Hi,
I've big problem with monitoring number of file in directory. This is my item:
zabbix 1.8.6
type: zabbix agent (active)
key: bash_script[/path/to/dir/, .log] # second parameter is suffix of searched files
Script returns number of files with suffix in directory (ls -1 $1 | grep $2 | wc -l). User parameter is set correctly.
UserParameter= bash_script[*], ls -1 $1 | grep $2 | wc -l
When I run the script via command line everything is OK (output is 900-1000 files ). When I run the script via zabbix once is returned value cca 600, then cca 1000, then cca 600 again etc. Log files are generated randomly.
zabbix_agentd.log (every value send from host is higher than 1000 viz log example)
Any idea to solve this problem? And maybe important information the monitored server is connected with zabbix_server by vpn CheckPoint.
I've big problem with monitoring number of file in directory. This is my item:
zabbix 1.8.6
type: zabbix agent (active)
key: bash_script[/path/to/dir/, .log] # second parameter is suffix of searched files
Script returns number of files with suffix in directory (ls -1 $1 | grep $2 | wc -l). User parameter is set correctly.
UserParameter= bash_script[*], ls -1 $1 | grep $2 | wc -l
When I run the script via command line everything is OK (output is 900-1000 files ). When I run the script via zabbix once is returned value cca 600, then cca 1000, then cca 600 again etc. Log files are generated randomly.
zabbix_agentd.log (every value send from host is higher than 1000 viz log example)
20855:20111205:135506.717 In send_buffer() host:'10.9.1.19' port:10051 values:1/100
20855:20111205:135506.718 JSON before sending [{
"request":"agent data",
"data":[
{
"host":"demz",
"key":" bash_script[\/data\/xmlforms\/D01\/, .log]",
"value":"1119",
"clock":1323089705}],
"clock":1323089706}]
20855:20111205:135506.719 JSON back [{
"response":"success",
"info":"Processed 1 Failed 0 Total 1 Seconds spent 0.000021"}]
20855:20111205:135506.719 In check_response() response:'{
"response":"success",
"info":"Processed 1 Failed 0 Total 1 Seconds spent 0.000021"}'
20855:20111205:135506.718 JSON before sending [{
"request":"agent data",
"data":[
{
"host":"demz",
"key":" bash_script[\/data\/xmlforms\/D01\/, .log]",
"value":"1119",
"clock":1323089705}],
"clock":1323089706}]
20855:20111205:135506.719 JSON back [{
"response":"success",
"info":"Processed 1 Failed 0 Total 1 Seconds spent 0.000021"}]
20855:20111205:135506.719 In check_response() response:'{
"response":"success",
"info":"Processed 1 Failed 0 Total 1 Seconds spent 0.000021"}'