Ad Widget

Collapse

Agentd's Initscript version 1.1.1 for redhat modified for fedora core 4

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • just2blue4u
    Senior Member
    • Apr 2006
    • 347

    #1

    Agentd's Initscript version 1.1.1 for redhat modified for fedora core 4

    The given redhat initscript for the agentd from 1.1.1.tar.gz didn't remove the PID-File correctly from "/var/run/zabbix/" on my Fedora Core 4 system. So i modified the script a bit:

    just copied the given initscript into /etc/init.d and added the line "rm -f $PIDFILE" as shown here:
    Code:
    ...
    # perform action based on args
    for ARG in $@ $ARGS
    do
            # check if PIDFILE exists and ensure is not zero size and react accordingly
            if [ -f $PIDFILE  ] && [ -s $PIDFILE ] ; then
                PID=`cat $PIDFILE`
                    if [ "x$PID" != "x" ] && kill -0 $PID 2>/dev/null ; then
                    STATUS="zabbix_agentd (pid $PID) running"
                    RUNNING=1
                else
                    STATUS="zabbix_agentd (pid $PID?) not running"
                    [color=red]rm -f $PIDFILE[/color]
                    RUNNING=0
                fi
        else
                STATUS="zabbix_agentd (no pid file) not running"
                RUNNING=0
        fi
    ...
    this works for me...
    Last edited by just2blue4u; 01-08-2006, 12:42.
    Big ZABBIX is watching you!
    (... and my 48 hosts, 4513 items, 1280 triggers via zabbix v1.6 on CentOS 5.0)
Working...