Ad Widget

Collapse

zabbix_sender send data to the active HA instance (whitout -c zabbix_agent2.conf)

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • omar.cacciotti
    Junior Member
    • Jul 2021
    • 25

    #1

    zabbix_sender send data to the active HA instance (whitout -c zabbix_agent2.conf)

    Hello there,

    I'm trying to achieve a goal but actually I didn't found a suitable solution.

    Scenario:
    I've a small-but-complex architecture in which Zabbix acts as orchestrator.
    Once Zabbix executes the script on a node (it's a couple of nodes) the selected node needs to "update" a zabbix trapper item on both hosts.

    If I use zabbix_sender -c -s -k value, the node is able to update his proper item only (and not the one of the other node) as expected (due to zabbix_agent2.conf directives).

    I need something like:

    Code:
    zabbix_sender -z ZBX_SRV1,ZBX_SRV2 -s "OTHER_NODE" -k SIAATIR.f1.s3.file.skipped -o "FILE: 0" --tls-connect psk --tls-psk-identity "OTHER_NODE_IDENTITY" --tls-psk-file /etc/zabbix/zabbix_agent2.d/other_node.psk
    So my script should able to update both hosts item by executing zabbix_sender twice:

    Code:
    zabbix_sender -z ZBX_SRV1,ZBX_SRV2 -s "THIS_NODE" -k SIAATIR.f1.s3.file.skipped -o "FILE: 0" --tls-connect psk --tls-psk-identity "THIS_NODE_IDENTITY" --tls-psk-file /etc/zabbix/zabbix_agent2.d/this_node.psk
    zabbix_sender -z ZBX_SRV1,ZBX_SRV2 -s "OTHER_NODE" -k SIAATIR.f1.s3.file.skipped -o "FILE: 0" --tls-connect psk --tls-psk-identity "OTHER_NODE_IDENTITY" --tls-psk-file /etc/zabbix/zabbix_agent2.d/other_node.psk
    Whitout using -c /etc/zabbix/zabbix_agent2.conf option, I'm unable to determine a priori the Active Zabbix Server Instance, so I should put 4 zabbix_sender command (two foreach node).

    Does someone have a solution?

    Thank you in advance
    best regard
  • Answer selected by omar.cacciotti at 11-09-2025, 00:06.
    omar.cacciotti
    Junior Member
    • Jul 2021
    • 25

    Sorry but I worked for hours and then posted here and 5 min later I found the solution.
    I'll share the solution for everyone who needs it.

    I mistaken the combination of -c config with the override capability of other options.

    Even if nodename, psk identity, psk cypher and other infos are written in the "node A" config file, I'm able to overwrite the blocking options with values of "node B", so:

    Code:
    zabbix_sender -c /etc/zabbix/zabbix_agent2.conf -s "THIS_NODE" -k SIAATIR.f1.s3.file.skipped -o "FILE: 0" --tls-connect psk --tls-psk-identity "THIS_NODE_IDENTITY" --tls-psk-file /etc/zabbix/zabbix_agent2.d/this_node.psk
    zabbix_sender -c /etc/zabbix/zabbix_agent2.conf -s "OTHER_NODE" -k SIAATIR.f1.s3.file.skipped -o "FILE: 0" --tls-connect psk --tls-psk-identity "OTHER_NODE_IDENTITY" --tls-psk-file /etc/zabbix/zabbix_agent2.d/other_node.psk
    In this way I have not to select the Zabbix server manually or try with multiple sender to different zabbix instances.

    P.S.
    Code:
    zabbix_sender -c /etc/zabbix/zabbix_agent2.conf -s "THIS_NODE" -k SIAATIR.f1.s3.file.skipped -o "FILE: 0" --tls-connect psk --tls-psk-identity "THIS_NODE_IDENTITY" --tls-psk-file /etc/zabbix/zabbix_agent2.d/this_node.psk
    is equal to:

    Code:
    zabbix_sender -c /etc/zabbix/zabbix_agent2.conf -k SIAATIR.f1.s3.file.skipped -o "FILE: 0"

    Comment

    • omar.cacciotti
      Junior Member
      • Jul 2021
      • 25

      #2
      Sorry but I worked for hours and then posted here and 5 min later I found the solution.
      I'll share the solution for everyone who needs it.

      I mistaken the combination of -c config with the override capability of other options.

      Even if nodename, psk identity, psk cypher and other infos are written in the "node A" config file, I'm able to overwrite the blocking options with values of "node B", so:

      Code:
      zabbix_sender -c /etc/zabbix/zabbix_agent2.conf -s "THIS_NODE" -k SIAATIR.f1.s3.file.skipped -o "FILE: 0" --tls-connect psk --tls-psk-identity "THIS_NODE_IDENTITY" --tls-psk-file /etc/zabbix/zabbix_agent2.d/this_node.psk
      zabbix_sender -c /etc/zabbix/zabbix_agent2.conf -s "OTHER_NODE" -k SIAATIR.f1.s3.file.skipped -o "FILE: 0" --tls-connect psk --tls-psk-identity "OTHER_NODE_IDENTITY" --tls-psk-file /etc/zabbix/zabbix_agent2.d/other_node.psk
      In this way I have not to select the Zabbix server manually or try with multiple sender to different zabbix instances.

      P.S.
      Code:
      zabbix_sender -c /etc/zabbix/zabbix_agent2.conf -s "THIS_NODE" -k SIAATIR.f1.s3.file.skipped -o "FILE: 0" --tls-connect psk --tls-psk-identity "THIS_NODE_IDENTITY" --tls-psk-file /etc/zabbix/zabbix_agent2.d/this_node.psk
      is equal to:

      Code:
      zabbix_sender -c /etc/zabbix/zabbix_agent2.conf -k SIAATIR.f1.s3.file.skipped -o "FILE: 0"

      Comment

      Working...