-1

I am little confuse in zabbix triggers expresion, right now i am triggering an application count netstat -anp | grep 1433 |wc -l but I am getting no data from these trigger, can any one please help?

thanks in advance
item proc.num[1433] trigger {hostname:proc.num[1433].last()}>1500

Kalana
  • 5,631
  • 7
  • 30
  • 51

1 Answers1

0

Zabbix Agent doesn't have any key to count TCP/UDP connections. To collect the result of netstat you need a custom script, through user parameter. Also note that grep -c prints the number of lines, for example:

To count established connections on port 443:

netstat -an | egrep -c ":443 *ESTABLISHED"
Iron Bishop
  • 1,749
  • 1
  • 7
  • 16
  • I am using userparameter Option: UserParameter=database.user.count,netstat -anp | grep 1433 | wc -l – Gundeep singh Feb 04 '20 at 14:35
  • netstat -an | egrep -c ":1433 *ESTABLISHED" this command is not giving any output – Gundeep singh Feb 04 '20 at 14:37
  • Weird. I tested it on grep (GNU grep) 2.20, GNU bash, version 4.2.46(2), CentOS Linux release 7.6.1810 ... can you confirm 1443 is the port, not the pid? – Iron Bishop Feb 04 '20 at 15:16
  • 1
    1433 is a port for Database server, netstat -anp | grep 1433 | wc -l this command gives me the no of connection on this port right now the total no connection is 11621 – Gundeep singh Feb 04 '20 at 15:49