Ad Widget

Collapse

Templates and CLI commands

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bcnx
    Junior Member
    • Jan 2011
    • 19

    #1

    Templates and CLI commands

    Hi all,

    something I've been wondering about for some time: there are templates that use certain CLI commands (like nvme-cli or arcconf) but I never seem to find references to those CLI commands in templates. What am I missing there?

    Cheers,

    BC
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1782

    #2
    That's because the CLI command is not configured in the template but in the Zabbix agent configuration. I always document such configurations in the Description field in the template. For example I have this in one of my templates (in the Description):

    Required user parameter:
    UserParameter=mysql.partitioning,echo "select count(*) from information_schema.partitions where table_schema='zabbix' and partition_name='$(date -d "+1 day" +p%Y_%m_%d)';" | HOME=/var/lib/zabbix mysql --connect-timeout 1 -N 2>/dev/null || echo 0


    This UserParameter configuration means that the item key (that is used in the template) is mysql.partitioning, and the rest of the line is the CLI commands that are run on that host whenever this item is requested.

    Markku

    Comment

    • bcnx
      Junior Member
      • Jan 2011
      • 19

      #3
      Hi Markku,

      makes perfect sense, thanks!
      Not every description clearly holds this information, good thing you add it purposely!

      cheers,

      BC

      Comment

      Working...