PDA

View Full Version : http command query


allrise
07-08-2009, 14:00
Hi,

Can anyone tell me linux command to get status for "http" simple check?

nelsonab
07-08-2009, 21:14
There is no Linux command per se, but you can emulate it with other tools such as nmap

nmap -p 80 <host> | egrep "open|closed|filter" | cut -f2 -d" "

This will return open, closed or filtered.

allrise
10-08-2009, 07:18
There is no Linux command per se, but you can emulate it with other tools such as nmap

nmap -p 80 <host> | egrep "open|closed|filter" | cut -f2 -d" "

This will return open, closed or filtered.

thanks for information

but basically i wanted to know internally how zabbix get "http" status for simple check? I mean they must be using some command to check it?

Calimero
10-08-2009, 09:41
Take a look at src/libs/zbxsysinfo/simple/simple.c for zabbix_agentd's code for net.tcp.service.

I don't know what code zabbix_server uses for simple checks (http, ssh, ftp_perf ...). I suspect it's the same code but I don't have time to digg.

allrise
19-08-2009, 07:10
There is no Linux command per se, but you can emulate it with other tools such as nmap

nmap -p 80 <host> | egrep "open|closed|filter" | cut -f2 -d" "

This will return open, closed or filtered.

Hi,

I am using your Linux nmap command mentioned above to check http status. There is an issue with nmap command (for instance if host is machine is down than output of this command is nothing).

I have added one cronjob which get the status of nmap command after one min, reason behind adding this cronjob is that I am cross checking command output with zabbix "http" status of simple check, which is not matching.

Can you please guide me on this? So I can get correct result.

Tim S
19-08-2009, 16:56
(echo "get";sleep 0.5)| telnet web-server-ip 80

would be one place to start.