Ad Widget

Collapse

Autodiscovery check: no event generated on closed tcp port

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nixdummy
    Junior Member
    • Mar 2013
    • 13

    #1

    Autodiscovery check: no event generated on closed tcp port

    using zabbix 2.4.5 sia

    I'm trying to automate the installation of zabbix agents on monitored hosts - but sadly had no luck yet. The idea is following: check an ip range for ICMP and open 10050 ports and if a host has successful ping but closed port, trigger an "autoinstall" action (a "winexe" external script - but that's not so important).

    Here's how I do it:
    - first i made an autodiscovery rule - scan an ip range 10.20.30-40.100 (the last digit is always 100)
    - check for ping and open tcp port 10050
    - then added an new entry in actions section with various conditions:
    1) "check = ping" AND "check != tcp(10050)"
    2) "state unavailable/lost/discovered" AND "check eq tcp(10050)"
    ...and many, many others...
    - finally added what should be done on this condition
    simply add the host to the "discovered hosts" group

    I tried five or six different conditions - none worked. No hosts are added to the group.
    In the "Monitoring"-"Discovery" I see the discovered hosts, "ping" fiels are all green, but the TCP(10050) is green only on hosts with an installed zabbix agent. Hosts without an installed zabbix agent got this field empty - without any color or comment. So I assume, that if this port is closed or filtered (not open), the check does not generate any kind of event. And without an event it is useless to play with action conditions.

    So here's my question: is this an unresolvable problem?
    Maybe there is a way to customize the discovery checks/scripts and the events they generate, or even redifine the autodiscovery events?
  • nixdummy
    Junior Member
    • Mar 2013
    • 13

    #2
    Tired waiting - added a feature request ZBXNEXT-3213.

    If someone needs the script, here is it:

    winexe -U 'Administrator%AdminPassWord' //12.13.14.100 "cmd.exe /C net use x: \\\\21.31.41.3\\temp /user:MyDomain\SomeUser UserPass && X:\zabbixagent.exe"

    A little explanation:
    I installed "winexe" on the zabbix server (zypper install winexe) - it is a linux version of "psexec". It connects to a windows host 12.13.14.100, with the user 'Administrator' and password 'AdminPassWord'. Then it starts windows command line and connects a share on my PC 21.31.41.3 named 'temp' as a network drive 'X:'. Finally it runs an installer of the zabbix agent 'zabbixagent.exe'. After all this the host is available for agent checks.

    Anyway if someone has any ideas about my main problem, I'll be happy to know about it.

    Comment

    Working...