Ad Widget

Collapse

some suggestions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scotti
    Member
    • Dec 2005
    • 32

    #1

    some suggestions

    1, the UserParameter's command part seems not support awk, ( sed ? ) , it's a little pity maybe.

    2, after killing the process zabbix_agentd with "killall zabbix_agentd", you cannot start it directly use /path/zabbix_agentd,There maybe double errors:
    a.[Address already in use]. Another zabbix_agentd already running ?
    b.File [/var/tmp/zabbix_agentd.pid] exists
    ===>$ tail -30 logs/zabbix_agentd.log
    015047:20051218:170304 Got signal. Exiting ...
    015072:20051218:170323 zabbix_agentd started. ZABBIX 1.1beta4.
    015072:20051218:170323 Cannot bind to port 10050. Error [Address already in use]. Another zabbix_agentd already running ?
    015077:20051218:170342 File [/var/tmp/zabbix_agentd.pid] exists. Is this process already running ?
    015081:20051218:170351 zabbix_agentd started. ZABBIX 1.1beta4.
    015082:20051218:170351 zabbix_agentd 15082 started

    3, the configration file's path cannot redirect by --prefix while do configure. and when I modified the configrations, I had to stop & start the daemon.
  • Nate Bell
    Senior Member
    • Feb 2005
    • 141

    #2
    Originally posted by scotti
    1, the UserParameter's command part seems not support awk, ( sed ? ) , it's a little pity maybe.
    Hmm, these are pretty useful commands to have. I've had some weirdness with cut and sed in the past, as in the commands would generate errors. This is a thought, but perhaps specifying the complete path to the commands might help, such as /bin/sed and /usr/bin/awk. Worst case, you could point the UserParameter to a script that uses these commands, or all sorts of trickery to get the desired effect without them.

    2, after killing the process zabbix_agentd with "killall zabbix_agentd", you cannot start it directly use /path/zabbix_agentd,There maybe double errors:
    a.[Address already in use]. Another zabbix_agentd already running ?
    b.File [/var/tmp/zabbix_agentd.pid] exists
    ===>$ tail -30 logs/zabbix_agentd.log
    015047:20051218:170304 Got signal. Exiting ...
    015072:20051218:170323 zabbix_agentd started. ZABBIX 1.1beta4.
    015072:20051218:170323 Cannot bind to port 10050. Error [Address already in use]. Another zabbix_agentd already running ?
    015077:20051218:170342 File [/var/tmp/zabbix_agentd.pid] exists. Is this process already running ?
    015081:20051218:170351 zabbix_agentd started. ZABBIX 1.1beta4.
    015082:20051218:170351 zabbix_agentd 15082 started
    The agent isn't going to be able to start up again immediately after being stopped, because the port that the agent uses will take a few seconds (or longer) to drop the old zabbix agent processes. There is a command you can add to your init script to check if the port is free:
    Code:
    netstat -an | grep 10050 | wc -l
    If this returns anything greater than 0, than the port that Zabbix uses (if you're using the default of 10050) is still in use. My restart condition checks, waits 10 seconds, and then checks again until the port is ready for a new Zabbix agent.

    Finally, yes, the .pid file sometimes doesn't get removed when you kill a Zabbix agent. You might add a check to your start and restart conditions in your init script that does a
    Code:
    NAME=zabbix_agentd
    PID=/var/tmp/$NAME.pid
    state=$(ps ax | grep zabbix_agent | grep -v grep | wc -l)
            if [[ "$state" -eq "0" ]] && [[ -f $PID ]]; then
               rm $PID
            fi
    If it doesn't find a running zabbix_agent, and the old .pid file still exists, then it removes the .pid file and starts the agent.

    Comment

    • scotti
      Member
      • Dec 2005
      • 32

      #3
      thanks for your kindly notice.
      Last edited by scotti; 22-12-2005, 12:36.

      Comment

      Working...