summaryrefslogtreecommitdiffstats
path: root/src/zabbix_agent
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2001-05-29 15:38:33 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2001-05-29 15:38:33 +0000
commitcce9230665661ebcc41880119608984e06e21caf (patch)
treeb4be5ee5ff84651a233ec41cc4a16a5e0e7a4ef1 /src/zabbix_agent
parentec819ed4096fce17ea7e8d17e653d6ca64e42105 (diff)
downloadzabbix-cce9230665661ebcc41880119608984e06e21caf.tar.gz
zabbix-cce9230665661ebcc41880119608984e06e21caf.tar.xz
zabbix-cce9230665661ebcc41880119608984e06e21caf.zip
Fixed function EXECUTE. netstat -at replaced by netstat -lt.
git-svn-id: svn://svn.zabbix.com/trunk@73 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/zabbix_agent')
-rw-r--r--src/zabbix_agent/sysinfo.c6
-rw-r--r--src/zabbix_agent/zabbix_agent.c14
2 files changed, 12 insertions, 8 deletions
diff --git a/src/zabbix_agent/sysinfo.c b/src/zabbix_agent/sysinfo.c
index 86ba4767..778126d1 100644
--- a/src/zabbix_agent/sysinfo.c
+++ b/src/zabbix_agent/sysinfo.c
@@ -332,7 +332,11 @@ float EXECUTE(char *command)
return FAIL;
}
fgets(c,1024,f);
- pclose(f);
+
+ if(pclose(f) != 0)
+ {
+ return FAIL;
+ }
sscanf(c, "%f", &result );
diff --git a/src/zabbix_agent/zabbix_agent.c b/src/zabbix_agent/zabbix_agent.c
index 27c36d51..a64f187d 100644
--- a/src/zabbix_agent/zabbix_agent.c
+++ b/src/zabbix_agent/zabbix_agent.c
@@ -72,13 +72,13 @@ COMMAND commands[]=
{"ping" ,PING, 0},
{"tcp_count" ,EXECUTE, "netstat -tn|grep EST|wc -l"},
- {"net[listen_21]" ,EXECUTE, "netstat -an|grep LISTEN|grep -v grep|grep ':21 '|wc -l"},
- {"net[listen_22]" ,EXECUTE, "netstat -an|grep LISTEN|grep -v grep|grep ':22 '|wc -l"},
- {"net[listen_23]" ,EXECUTE, "netstat -an|grep LISTEN|grep -v grep|grep ':23 '|wc -l"},
- {"net[listen_25]" ,EXECUTE, "netstat -an|grep LISTEN|grep -v grep|grep ':25 '|wc -l"},
- {"net[listen_80]" ,EXECUTE, "netstat -an|grep LISTEN|grep -v grep|grep ':80 '|wc -l"},
- {"net[listen_110]" ,EXECUTE, "netstat -an|grep LISTEN|grep -v grep|grep ':110 '|wc -l"},
- {"net[listen_143]" ,EXECUTE, "netstat -an|grep LISTEN|grep -v grep|grep ':143 '|wc -l"},
+ {"net[listen_21]" ,EXECUTE, "netstat -ln|grep tcp|grep -v grep|grep ':21 '|wc -l"},
+ {"net[listen_22]" ,EXECUTE, "netstat -ln|grep tcp|grep -v grep|grep ':22 '|wc -l"},
+ {"net[listen_23]" ,EXECUTE, "netstat -ln|grep tcp|grep -v grep|grep ':23 '|wc -l"},
+ {"net[listen_25]" ,EXECUTE, "netstat -ln|grep tcp|grep -v grep|grep ':25 '|wc -l"},
+ {"net[listen_80]" ,EXECUTE, "netstat -ln|grep tcp|grep -v grep|grep ':80 '|wc -l"},
+ {"net[listen_110]" ,EXECUTE, "netstat -ln|grep tcp|grep -v grep|grep ':110 '|wc -l"},
+ {"net[listen_143]" ,EXECUTE, "netstat -ln|grep tcp|grep -v grep|grep ':143 '|wc -l"},
{0 ,0}
};