Ad Widget

Collapse

Alternative ways to test host availability

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bigm
    Junior Member
    • Sep 2015
    • 2

    #1

    Alternative ways to test host availability

    Zabbix - 2.2 LTS
    REHL 5 - Mysql DB back end

    Running 1 server with 2 proxies

    I've been testing Zabbix and an alternative monitoring system for the past few weeks as part of a POC and have had some great successes. However I have a unique issue in determining if a host is available or not. We have some embedded systems in a isolated part of our network. As such, we are unable to install the zabbix agent, and SNMP is not possible either. And to top it off... ICMP is blocked at the FW due to a security policy.

    I have created items do simple checks - doing tcp probes on the host's open ports (mainly https) This is working successfully. I understand I can create triggers etc based on that. However, the host availability icons remain greyed out under the host list page.
    (At this stage, we are only concerned with host availability.)

    It would be nice to confirm the host availability within Zabbix via things like simple check, so things like the availability reporting will be complete.

    I've tried things like changing the 'Show Value' in the item configured to 'Agent Ping Status' (as both successful probes return 1). But this clearly doesn't update the actual agent status - but rather just tags that data.

    Is there a way to update host availability without using snmp, ICMP or agent ping etc - more so, with a TCP simple check or calculated item or something?

    Even if it was a hack job - using zabbix_send cli tool or something.

    Any ideas?


    Cheers,
    BigM
  • akbar415
    Senior Member
    • May 2015
    • 119

    #2
    Originally posted by bigm
    Zabbix - 2.2 LTS
    REHL 5 - Mysql DB back end

    Running 1 server with 2 proxies

    I've been testing Zabbix and an alternative monitoring system for the past few weeks as part of a POC and have had some great successes. However I have a unique issue in determining if a host is available or not. We have some embedded systems in a isolated part of our network. As such, we are unable to install the zabbix agent, and SNMP is not possible either. And to top it off... ICMP is blocked at the FW due to a security policy.

    I have created items do simple checks - doing tcp probes on the host's open ports (mainly https) This is working successfully. I understand I can create triggers etc based on that. However, the host availability icons remain greyed out under the host list page.
    (At this stage, we are only concerned with host availability.)

    It would be nice to confirm the host availability within Zabbix via things like simple check, so things like the availability reporting will be complete.

    I've tried things like changing the 'Show Value' in the item configured to 'Agent Ping Status' (as both successful probes return 1). But this clearly doesn't update the actual agent status - but rather just tags that data.

    Is there a way to update host availability without using snmp, ICMP or agent ping etc - more so, with a TCP simple check or calculated item or something?

    Even if it was a hack job - using zabbix_send cli tool or something.

    Any ideas?


    Cheers,
    BigM
    Zabbix require a least one interface(agent ping, snmp, ipmi and jmx) to add a new host.
    Probably you setup agent interface but, like you said, you can't install zabbix agent on this host or user snmp.

    You can't just ignore zabbix agent status and if appropriate disable the trigger to zabbix status agent.

    Comment

    • bigm
      Junior Member
      • Sep 2015
      • 2

      #3
      Thanks for you input.

      What I've done in the end was to develop a python script using the zabbix API bindings. The script will attempt to make a TCP connection to the specified host and port. If connection is successful, it will update the host status as available, if unsuccessful, it will update it as unavailable.

      What I was surprised was that in the documentation, it said this record was read-only via the API. Initially I thought I would need to change the value by connecting directly to the DB. Its easy to see the value in the 'hosts' table. However, after trying, it seems to work fine modifying the status via the API.

      Here is a code snippet which updates the availability status.


      Code:
              #####################
      	# zabbix_avaliability
      	# @host - hostname of host to update in zabbix
      	# @avaliabilityID - availability status - 0 unknown, 1 available, 2 not available
      	# updates zabbix host availability status
      	#####################				
      	def zabbix_avalibaility(self, host=None, avaliability=None):		
      			
      		self.avaliability = avaliability
      		self.host = host
      		
      		zapi = ZabbixAPI(self.zabbix_server)
      		zapi.session.verify = False
      		zapi.login(self.zabbix_user,self.zabbix_pass)
      		hosts = zapi.host.get(filter={"host": self.host})
      		
      		if hosts:
      			host_id = hosts[0]["hostid"]
      			result=zapi.host.update(hostid=host_id,available=self.avaliability)
      		else:
      			self.error("[Zabbix] error: cannot find host in zabbix", -1)
      
      		return None
      * Apologies if the code snippet isn't formatted correctly.

      Comment

      Working...