Ad Widget

Collapse

Character Limit for Macro?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jabberwalker
    Junior Member
    • Mar 2020
    • 3

    #1

    Character Limit for Macro?

    Hello,

    I am new to Zabbix but so far I am really enjoying it. I have a lot to learn though and this is probably a fairly simple problem to solve but so far I haven't been able to find it in any Google searches.
    I imported some templates for Windows Servers and in my test group I have been able to get some really good data back. One of the problems I found was that the service monitoring was a little noisy. Some of the services it is alerting for, I don't want to be alerted about.

    So I found the template for it named "Template Module Windows services by Zabbix agent" and the rules that govern the services are in the Macros section. I saw the values in {$SERVICE.NAME.NOT_MATCHES} and added a couple of the names of services I wanted to exclude from alerting before running up against what appears to be a character limit. I figured that was no big deal and that I should just add another line with the same Macro name with different values but apparently that isn't supported so I'm not sure how best to navigate the issue now. How can I add more services to be ignored from this template? Thank you.

    Click image for larger version

Name:	Zabbix.PNG
Views:	1460
Size:	69.5 KB
ID:	397330

  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    Use global regular expressions. You can find an example in the documentation or in the standard network discovery templates

    Comment

    • jabberwalker
      Junior Member
      • Mar 2020
      • 3

      #3
      I found this page:

      and added the service names to the "Windows service names for discovery" "Result is FALSE" which seems to be the solution.
      I have a whole lot to learn about this but this was incredibly helpful. Thank you, Hamardaban.

      Comment

      • soumya
        Junior Member
        • Nov 2013
        • 21

        #4
        Hi @jabberwalker,

        your problem will be solved if you follow as per below.

        /usr/share/zabbix/include/schema.inc.php


        PHP Code:
                                 'hostmacro' => [
                                                     
        'key' => 'hostmacroid',
                                                     
        'fields' => [
                                                      ],
                                                     
        'value' => [
                                                     
        'null' => false,
                                                     
        'type' => DB::FIELD_TYPE_CHAR,
        3498 -                                   'length' => 255,
        3498 +                                  'length' => 1024,
                                                     
        'default' => 
        ',

        /usr/share/zabbix/include/classes/html/CTextAreaFlexible.php


        PHP Code:
         const ZBX_STYLE_CLASS 'textarea-flexible';

                                                         
        /**
                                                          * An options array.
                                                          *
                                                          * @var array
                                                          */
                                                          
        protected $options = [
                                                          
        'add_post_js' => true,
        35 -                                            'maxlength' => 255,
        35 +                                           'maxlength' => 1024,
                                                          
        'readonly' => false,
                                                          
        'rows' => 1
                                                          
        ]; 

        Comment


        • soumya
          soumya commented
          Editing a comment
          you can modify other macro value as per your need.
      Working...