We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Got a problem with an agent configured on a non standard port, it never received fix actions.
script fix.py use zabbix_get only on the standard port (10050)
Here is a patch for fix.py to retreive agent port from Zabbix API and use it :
def do_fix(vname, fix_cmd): try: h = zapi.host.get(filter={'name': vname}, output=['hostid']) if len(h) == 0: logging.warning('Can\'t find host {} in Zabbix. Skip fixing vulnerabilities on this host.'.format(vname)) return False h_if = zapi.hostinterface.get(hostids=h[0]['hostid'], filter={'main': '1', 'type': '1'}, output=['dns', 'ip', 'useip','port'])[0] if h_if['useip'] == '1': h_conn = h_if['ip'] else: h_conn = h_if['dns'] h_port = h_if['port'] if use_zbx_agent_to_fix: cmd = '{z_get_bin} -s {h_conn} -p {h_port} -k "system.run[{fix_cmd},nowait]"'.format(z_get_bin=z_get_bin, h_conn=h_conn, h_port=h_port, fix_cmd=fix_cmd) else: cmd = 'ssh {} -l {} "{}"'.format(h_conn, ssh_user, fix_cmd) logging.info(cmd) out = shell(cmd) logging.info(out) return True except Exception as e: logging.info('Exception: {}'.format(e)) return False
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Got a problem with an agent configured on a non standard port, it never received fix actions.
script fix.py use zabbix_get only on the standard port (10050)
Here is a patch for fix.py to retreive agent port from Zabbix API and use it :
The text was updated successfully, but these errors were encountered: