Ad Widget

Collapse

how to add new menus

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fserto
    Junior Member
    • Jun 2009
    • 7

    #1

    how to add new menus

    Hi,

    We're looking into replacing an in-house developed monitoring tool with Zabbix (or Nagios). On our current monitoring, we have a bunch of built-in tools, like browsing a TFTP directory, switches and routers configs, find the switch a host is conencted to, and a lot more.

    So, what I'm trying to do is customize the menus, and add another one called 'Tools', with a few sub-menus for all tools.

    I was looking into adding it to page_header.php, but just adding another item to the array, doesn't seem to work properly, as the mouseout function does not hide the new menu.

    This is what I'm trying to add:

    Code:
    'tools'=>array(
            'label'                 => 'Tools',
            'user_type'             => USER_TYPE_ZABBIX_USER,
            'node_perm'             => PERM_READ_LIST,
            'default_page_id'       => 0,
            'pages'=>array(
            array('url'=>'tools1.php' ,'label'=>'Tools1       )
            )
    ),
    I can rename one of the existing ones, for example cm, but that's not really how I want to do this, as there may be another couple of items I would like to add.

    Cheers,
    Fernando
  • Aly
    ZABBIX developer
    • May 2007
    • 1126

    #2
    Look into js/common.js, there is js object mmenu
    Zabbix | ex GUI developer

    Comment

    • fserto
      Junior Member
      • Jun 2009
      • 7

      #3
      Awesome!

      Thanks Aly.

      Comment

      • vinny
        Senior Member
        • Jan 2008
        • 145

        #4
        I searched through the JS file but do not find the way to make our new menu disappear....

        What did u change to make it work ?

        thx,
        vinny
        -------
        Zabbix 1.8.3, 1200+ Hosts, 40 000+ Items...zabbix's everywhere

        Comment

        • Calimero
          Senior Member
          • Nov 2006
          • 481

          #5
          Quick hack based on what is written above

          Code:
          frontends/php$ svn diff js include/page_header.php
          Index: js/common.js
          ===================================================================
          --- js/common.js        (revision 16)
          +++ js/common.js        (working copy)
          @@ -501,7 +501,7 @@
           // Author: Aly
          
           var MMenu = {
          -menus:                 {'empty': 0, 'view': 0, 'cm': 0, 'reports': 0, 'config': 0, 'admin': 0},
          +menus:                 {'empty': 0, 'view': 0, 'cm': 0, 'reports': 0, 'config': 0, 'admin': 0, 'tools': 0},
           def_label:             null,
           sub_active:    false,
           timeout:               null,
          Index: include/page_header.php
          ===================================================================
          --- include/page_header.php     (revision 16)
          +++ include/page_header.php     (working copy)
          @@ -255,6 +255,18 @@
                                                          'sub_pages'=>array('setup.php','warning.php'))
                                                  )
                                          ),
          +               'tools'=>array(
          +                               'label'                 => "Tools",
          +                               'user_type'             => USER_TYPE_ZABBIX_USER,
          +                               'node_perm'             => PERM_READ_WRITE,
          +                               'default_page_id'       => 1,
          +                               'forse_disable_subnodes'=> true,
          +                               'pages'=>array(
          +                                       array('url'=>'tools_1.php', 'label'=>'Tool #1'),
          +                                       array('url'=>'tools_2.php', 'label'=>'Tool #2'),
          +                                       array('url'=>'tools_3.php', 'label'=>'Tool #3'),
          +                                       )
          +                               ),
                          'login'=>array(
                                          'label'                 => S_LOGIN,
                                          'user_type'             =>      0,

          Comment

          • vinny
            Senior Member
            • Jan 2008
            • 145

            #6
            all right,
            I didn't check menus var

            thx for all,
            vinny
            -------
            Zabbix 1.8.3, 1200+ Hosts, 40 000+ Items...zabbix's everywhere

            Comment

            • russhenry715
              Member
              • Aug 2009
              • 32

              #7
              how would i be able to open a link in a new window? such as our helpdesk would open under tools -> helpdesk

              Comment

              • Pragathi
                Junior Member
                • May 2019
                • 7

                #8
                Hello guys, I have a same issue, how would i be able to open a link in a new window? such as our helpdesk would open under tools -> helpdesk

                Thank you.

                Comment

                Working...