Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • None
    • Unix Agent, Web Interface
    • Observium 0.13.6.4162
      CentOS 6.4

    Description

      There are two menu tabs for Memcached App and it looks like data is collected only on one of them. Please see attached screenshot.

      Regards

      Attachments

        Activity

          [OBS-363] Memchached - two menu tabs

          @Sebastian:

          Here is the command which does the work for you:

          DELETE FROM `applications` WHERE app_type="memcached" AND app_instance IS NULL

          Best,
          Balazs

          zsilbi Balázs Németh added a comment - @Sebastian: Here is the command which does the work for you: DELETE FROM `applications` WHERE app_type= "memcached" AND app_instance IS NULL Best, Balazs
          HTF Sebastian added a comment -

          @Balázs Németh

          Could you please let me know what's the table name so I can remove it. I couldn't find it in 'app_type' table:

          mysql> SELECT app_type FROM applications GROUP BY app_type;
          ----------

          app_type

          ----------

          apache
          drbd
          mysql
          nfs
          nginx

          ----------
          5 rows in set (0.00 sec)

          @Adam Armstrong

          When this fix will be available in Open Source Edition?

          Regards

          HTF Sebastian added a comment - @Balázs Németh Could you please let me know what's the table name so I can remove it. I couldn't find it in 'app_type' table: mysql> SELECT app_type FROM applications GROUP BY app_type; ---------- app_type ---------- apache drbd mysql nfs nginx ---------- 5 rows in set (0.00 sec) @Adam Armstrong When this fix will be available in Open Source Edition? Regards

          Fixed in 4733.

          You may need to delete the file before you svn up if you've modified it, as the fix is slightly different to Balazs' fix.

          adama Adam Armstrong added a comment - Fixed in 4733. You may need to delete the file before you svn up if you've modified it, as the fix is slightly different to Balazs' fix.

          Hello,

          This prevents from adding the unnecessary second tab in the future.
          To remove the existing tab, you need to delete it from the database table.

          Best,
          Balazs

          zsilbi Balázs Németh added a comment - Hello, This prevents from adding the unnecessary second tab in the future. To remove the existing tab, you need to delete it from the database table. Best, Balazs
          HTF Sebastian added a comment -

          Hi,

          Thanks for your reply.

          Sorry but I modified this file as above but I still got two tabs for memcached.

          Regards

          HTF Sebastian added a comment - Hi, Thanks for your reply. Sorry but I modified this file as above but I still got two tabs for memcached. Regards
          zsilbi Balázs Németh added a comment - - edited

          Hi,

          When memcache is polled, there has to be a hostname check.
          If the hostname isn't valid, it shouldn't be saved to the database.

          "Only run if we have a valid host with a : separating host:port"

          In \includes\polling\applications\memcached.inc.php the check is made but in \includes\polling\unix-agent.inc.php it was forgotten.

          /includes/polling/unix-agent.inc.php (Line: 167)

              // Memcached
                  if (!empty($agent_data['app']['memcached'])) {
                      foreach ($agent_data['app']['memcached'] as $memcached_host => $memcached_data) {
                          if (!strpos($memcached_host, ":")) //Only run if we have a valid host with a : separating host:port
                              continue;
           
                          if (dbFetchCell("SELECT COUNT(*) FROM `applications` WHERE `device_id` = ? AND `app_type` = ? AND `app_instance` = ?", array($device['device_id'], 'memcached', $memcached_host)) == "0") {
                              echo("Found new application 'Memcached $instance'\n");
                              dbInsert(array('device_id' => $device['device_id'], 'app_type' => 'memcached', 'app_instance' => $memcached_host), 'applications');
                          }
                      }
                  }
          

          Regards,
          Balazs

          zsilbi Balázs Németh added a comment - - edited Hi, When memcache is polled, there has to be a hostname check. If the hostname isn't valid, it shouldn't be saved to the database. "Only run if we have a valid host with a : separating host:port" In \includes\polling\applications\memcached.inc.php the check is made but in \includes\polling\unix-agent.inc.php it was forgotten. /includes/polling/unix-agent.inc.php (Line: 167) // Memcached if (!empty($agent_data['app']['memcached'])) { foreach ($agent_data['app']['memcached'] as $memcached_host => $memcached_data) { if (!strpos($memcached_host, ":")) //Only run if we have a valid host with a : separating host:port continue;   if (dbFetchCell("SELECT COUNT(*) FROM `applications` WHERE `device_id` = ? AND `app_type` = ? AND `app_instance` = ?", array($device['device_id'], 'memcached', $memcached_host)) == "0") { echo("Found new application 'Memcached $instance'\n"); dbInsert(array('device_id' => $device['device_id'], 'app_type' => 'memcached', 'app_instance' => $memcached_host), 'applications'); } } } Regards, Balazs
          HTF Sebastian added a comment -

          Hi,

          I've also disabled 'Memcached' App for specific server and it looks like it's enabled now (Settings -> Applications -> Device Properties -> Memcached) - is there some auto-enable function or is it because agent is detecting config file for Memcached on the monitored server?

          Regards

          HTF Sebastian added a comment - Hi, I've also disabled 'Memcached' App for specific server and it looks like it's enabled now (Settings -> Applications -> Device Properties -> Memcached) - is there some auto-enable function or is it because agent is detecting config file for Memcached on the monitored server? Regards

          People

            adama Adam Armstrong
            HTF Sebastian
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: