[ZBXNEXT-1212] Adding JMX/SNMP/IPMI interfaces with Auto-registration Created: 2012 May 01  Updated: 2020 Oct 28

Status: Reopened
Project: ZABBIX FEATURE REQUESTS
Component/s: Frontend (F), Java gateway (J), Server (S)
Affects Version/s: 2.0.0
Fix Version/s: None

Type: Change Request Priority: Minor
Reporter: Igor Urazov Assignee: Zabbix Support Team
Resolution: Unresolved Votes: 39
Labels: actions, autoregistration, jmx
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Doesn't matter


Issue Links:
Causes
Duplicate
is duplicated by ZBXNEXT-2072 Add host interfaces to Host Prototype Closed

 Description   

It would be nice if there is some way to automatically add JMX interface to auto-registered host, so template with JMX items could be linked automatically. Maybe another operator for action, like "Add interface" with requirements to specify type and port.



 Comments   
Comment by timmi [ 2012 Jun 21 ]

it would be very useful, especially for clouds

Comment by Chris Johnston [ 2012 Aug 01 ]

Happy with the auto-registration functionality in 2.0.2 but this would be a significant improvement when using Zabbix to monitor elastic cloud hosts and applications. Same for snmp/impi.

Comment by Max Lock [ 2012 Nov 07 ]

Maybe run script action as well? you could run external code that hits the API to do anything you want then.

Comment by ralphhu [ 2013 Feb 03 ]

i need this feature too. auto add snmp and impi interface!

Comment by prakhar jauhari [ 2013 Feb 22 ]

There has to be a option using which we can enable SNMP, JMX interface on auto registered hosts..

Comment by Noah Leaman [ 2013 Mar 11 ]

I need this as well. Specifically the SNMP interface in my case. The snmp based templates I used to auto link in 1.8 now are not able to be linked which, in my case, breaks all the templates assignments because the snmp template was linked with the main "default" template being linked during the auto reg process.

Comment by Noah Leaman [ 2013 Mar 27 ]

This should not be considered just an improvement requests. Auto linking broke from version 1.8 to 2.0 for people who auto link snmp templates. It's a regression.

Comment by Anton [ 2013 Jun 14 ]

Support. This is a very useful functionality.

Comment by Patrick Hemmer [ 2016 Apr 17 ]

This was also a significant problem for us because of auto-linking. Because we have templates with items which need JMX, auto registration failed to link ALL templates, not just the items (or at the very least, the templates) that need JMX. So the host would get added with no monitoring at all.

I ended up fixing this by adding a database trigger to auto add the JMX interface when the Agent interface is added. This allowed the auto-registration with template linking to work. Yes it ends up adding a JMX interface to all hosts, even those without JMX, but unless a monitoring item tries to use the JMX interface, nothing complains.

Below is the trigger for anyone interested in it. It's made for postgres. You'll likely need to change the port from 9810 to your JMX port:

CREATE OR REPLACE FUNCTION interface_create_jmx() RETURNS TRIGGER as $$
  BEGIN
    IF new.type != 1 OR new.main != 1 THEN
      RETURN NULL;
    END IF;
    BEGIN
      INSERT INTO interface (hostid,main,type,useip,ip,dns,port,bulk, interfaceid) SELECT new.hostid, 1, 4, new.useip, new.ip, new.dns, 9810, new.bulk, nextid+1 FROM ids WHERE table_name='interface' AND field_name='interfaceid';
      UPDATE ids SET nextid=nextid+1 WHERE table_name='interface' AND field_name='interfaceid';
    EXCEPTION
      WHEN unique_violation THEN
        -- do nothing
    END;
    RETURN NULL;
  END;
$$ LANGUAGE plpgsql;

CREATE TRIGGER interface_create_jmx AFTER INSERT ON interface
  FOR EACH ROW EXECUTE PROCEDURE interface_create_jmx();
Comment by Jon Beilke [ 2016 Nov 11 ]

+1 we really need this for SNMP/JMX monitoring of auto-registered hosts.

Comment by Noah Leaman [ 2016 Nov 17 ]

Back in early 2013, we were almost forced to move off Zabbix due the feature-breaking change back when 2.0 was released. We had to develop an external automation system that used various API calls just to allow auto-registrations to continue to work with SNMP linked templates.

It's sad to have to used a kludge just because we chose to use linked templates.

Comment by Jon Beilke [ 2017 Feb 24 ]

Used a setup similar to what Patrick did, but we use the zabbixapi gem to workaround this for now. Requires a script that fires during auto-registration to determine the system type, add the JMX interface, and then has to apply the templates with JMX items afterwards.

Would really streamline our process to have JMX interface and templates applied without needing the separate actions/scripts.

Comment by Jacek Lakomiec [ 2017 May 23 ]

This would be useful functionality in a large cloud environments hosting Java applications. Especially if you link templates to hosts matching certain auto registration criteria (for example: HostMetadata contains string "Cassandra" or "Elasticsearch"), you end up in a situation where adding JMX interface has to be done either manually or with post registration external scripts. Upvoted!

Comment by Venugopal Paccha [ 2017 Jun 22 ]

I came across same issue, however interface automation during auto-registration can be achieved through ansible zabbix module. We have successfully implemented in our environments.

Comment by Alexei Vladishev [ 2020 Oct 28 ]

I believe it has been implemented under https://support.zabbix.com/browse/ZBXNEXT-2072 in Zabbix 5.2.

Comment by Alexei Vladishev [ 2020 Oct 28 ]

Sorry, didn't notice that it is about auto-discovery, re-opened.

Generated at Tue Apr 01 11:40:15 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.