Ad Widget

Collapse

http command query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • allrise
    Junior Member
    • Mar 2009
    • 18

    #1

    http command query

    Hi,

    Can anyone tell me linux command to get status for "http" simple check?
    Last edited by allrise; 07-08-2009, 14:03.
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    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.
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • allrise
      Junior Member
      • Mar 2009
      • 18

      #3
      Originally posted by nelsonab
      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?

      Comment

      • Calimero
        Senior Member
        • Nov 2006
        • 481

        #4
        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.

        Comment

        • allrise
          Junior Member
          • Mar 2009
          • 18

          #5
          Originally posted by nelsonab
          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.

          Comment

          • Tim S
            Junior Member
            • Jun 2006
            • 13

            #6
            (echo "get";sleep 0.5)| telnet web-server-ip 80

            would be one place to start.

            Comment

            Working...