Ad Widget

Collapse

Automate an extra host interface creation without network discovery

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • And808
    Junior Member
    • Jan 2024
    • 11

    #1

    Automate an extra host interface creation without network discovery

    Hi,

    are there any means to automate an extra host interface (SNMP) creation on the host with assigning the SNMP template when network discovery is not an option?

    I'm new to Zabbix and presently I am evaluating and considering it to monitor hundreds of cloud instances. The automation is crucial for me because of the number of instances. In my understanding, the network discovery is not an option in my case because the cloud instances do not have any local IPs within a known and predictable subnet to scan.

    I opted for an autoregistration option, where the only primary agent host interface can be automatically created. However, I need to add a template that will monitor an internal application by SNMP which is possible the only when an extra SNMP host interface is created first.

    Is there anyone who has already solve the same issues and got any kind of scrips, template and guidelines applicable to this situation?
    Please correct me if I'm wrong in my understanding and assumptions of the Zabbix limitation possible to overcome.

  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Trigger a script (via send message action to your own defined media) that will add it over the API..

    Comment


    • And808
      And808 commented
      Editing a comment
      Hi cyber, thank you for giving this idea. Unfortunately, the scripting skill is not the best part of me. Are you aware of any libraries where a script like this might be available to the public?
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #3
    I don't write code either.. I have good coworkers ..
    I have no idea if someone has published something like that...

    Comment


    • And808
      And808 commented
      Editing a comment
      I'm playing around with the idea of triggering a script (via send message action to my own defined media - Type: Script) with Script parameter Value {Host.ID} set in it. Unfortunately, it looks like the value of {Host.ID} is not transferred to the script as the echo command prints {Host.ID} instead of its value. Can you please advise whether the Operation of Send message of Autoregistration actions is suitable for this? Or do you believe I have to create another type of action to trigger my script?
  • And808
    Junior Member
    • Jan 2024
    • 11

    #4
    My investigation shows that the value of {Host.ID} is transferred to my script well with a Trigger action, but not within the Autoregistration action itself. Probably this is because the Operation: Send message to users goes to the top of all operations and executes at the time when the host is not added yet to the system and {Host.ID} Value isn't defined. I'm still wondering:
    1. is it possible to set the order of Operations for Autoregistration actions and lower the order of send message execution?
    2. is any other action that can be applied with the custom trigger set to hit whenever a new host is autoregistered? (It'd be a more complex solution, however, I do not know yet the best sequence of steps to develop it)​

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4807

      #5
      First. it has to be {HOST.ID} not {Host.ID}..

      Comment


      • And808
        And808 commented
        Editing a comment
        yeah, sorry, I mistyped it here, but not there as it works fine there for a Trigger action for existing host. Now I just don't know which action(trigger) to use. I'm so disappointed that it's not possible to add SNMP interface with autoregistration action and now I'm upset even more that the message to trigger my script is being sent before the action of the host being added. I believe this is a true reason why {HOST.ID} is not being conveyed to the script.
        Last edited by And808; 24-01-2024, 15:30.
    Working...