diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | misc/conf/zabbix_agentd.conf | 4 | ||||
-rw-r--r-- | src/zabbix_agent/zabbix_agentd.c | 9 |
3 files changed, 12 insertions, 2 deletions
@@ -1,5 +1,6 @@ Changes for 1.1alpha11: + - added parameter DisableActive for zabbix_agentd (Alexei) - trigger expressions may contain spaces (Alexei) - improvements for snprintf.c (Alexei) - added table escalation_rules (Alexei) diff --git a/misc/conf/zabbix_agentd.conf b/misc/conf/zabbix_agentd.conf index e9328996..c65cb33b 100644 --- a/misc/conf/zabbix_agentd.conf +++ b/misc/conf/zabbix_agentd.conf @@ -35,6 +35,10 @@ StartAgents=5 #RefreshActiveChecks=120 +# Disable active checks. The agent will work in passive mode listening server. + +#DisableActive=1 + # Specifies debug level # 0 - debug is not created # 1 - critical information diff --git a/src/zabbix_agent/zabbix_agentd.c b/src/zabbix_agent/zabbix_agentd.c index f16c38e4..34f6f86d 100644 --- a/src/zabbix_agent/zabbix_agentd.c +++ b/src/zabbix_agent/zabbix_agentd.c @@ -73,6 +73,7 @@ char *CONFIG_PID_FILE = NULL; char *CONFIG_LOG_FILE = NULL; int CONFIG_AGENTD_FORKS = AGENTD_FORKS; int CONFIG_NOTIMEWAIT = 0; +int CONFIG_DISABLE_ACTIVE = 0; int CONFIG_TIMEOUT = AGENT_TIMEOUT; int CONFIG_LISTEN_PORT = 10050; int CONFIG_SERVER_PORT = 10051; @@ -236,6 +237,7 @@ void init_config(void) {"PidFile",&CONFIG_PID_FILE,0,TYPE_STRING,PARM_OPT,0,0}, {"LogFile",&CONFIG_LOG_FILE,0,TYPE_STRING,PARM_OPT,0,0}, /* {"StatFile",&CONFIG_STAT_FILE,0,TYPE_STRING,PARM_OPT,0,0},*/ + {"DisableActive",&CONFIG_DISABLE_ACTIVE,0,TYPE_INT,PARM_OPT,0,1}, {"Timeout",&CONFIG_TIMEOUT,0,TYPE_INT,PARM_OPT,1,30}, {"NoTimeWait",&CONFIG_NOTIMEWAIT,0,TYPE_INT,PARM_OPT,0,1}, {"ListenPort",&CONFIG_LISTEN_PORT,0,TYPE_INT,PARM_OPT,1024,32767}, @@ -483,8 +485,11 @@ int main(int argc, char **argv) } /* Initialize thread for active checks */ - s=strtok(CONFIG_HOSTS_ALLOWED,","); - pids[CONFIG_AGENTD_FORKS-1] = child_active_make(CONFIG_AGENTD_FORKS-1, s, CONFIG_SERVER_PORT); + if(CONFIG_DISABLE_ACTIVE==0) + { + s=strtok(CONFIG_HOSTS_ALLOWED,","); + pids[CONFIG_AGENTD_FORKS-1] = child_active_make(CONFIG_AGENTD_FORKS-1, s, CONFIG_SERVER_PORT); + } parent=1; |