Bug #45079 agent on FreeBSD7 does not show IP address in Meta Info on dashboard

Submitted: 25 May 2009 20:04 Modified: 14 Jan 2010 14:53
Reporter: Carsten Segieth Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Agent Severity:S3 (Non-critical)
Version:2.0.6.7158, 2.1.0 OS:FreeBSD (7)
Assigned to: Jan Kneschke CPU Architecture:Any
Tags: platforms

[25 May 2009 20:04] Carsten Segieth
Description:
The agents (both 32 + 64 bit) are running in a VirtualBox. In the Meta-Info on the dashboard only the localhost address is shown, but not the address that is visible from outside like it is for all other agents.

"<AGENT> --agent-run-os-tests" shows critical errors:
2009-05-21 02:08:14: (critical) network-socket.c.317: connect(127.0.0.1:3306) failed: Connection refused (61)
2009-05-21 02:08:14: (critical) sigar-test-all.c:593: sigar_net_interface_stat_get(em0) failed: 6
2009-05-21 02:08:14: (critical) sigar-test-all.c:601: sigar_net_interface_config_get(em0) failed: 6

-------------------------------------------------
59_freebsd7-x86-32_vbox-ua-1-vm1_36044  Meta Info
...	
OS          FreeBSD 7.1-RELEASE (FreeBSD 7.1-RELEASE)
CPU         CPU @ 2.93GHz
RAM         0.99 GB
Disk Space  / 13.55 GB (10.11 GB free)
IP Address  :
lo0: 127.0.0.1

<AGENT> --agent-run-os-tests
2009-05-21 02:08:14: (critical) network-socket.c.317: connect(127.0.0.1:3306) failed: Connection refused (61)
2009-05-21 02:08:14: (critical) sigar-test-all.c:593: sigar_net_interface_stat_get(em0) failed: 6
2009-05-21 02:08:14: (critical) sigar-test-all.c:601: sigar_net_interface_config_get(em0) failed: 6
sigar-test-all.c.129 (test_sigar_pid_get): 
  pid = 3342
sigar-test-all.c.111 (test_sigar_mem_get): 
  ...
sigar-test-all.c.642 (test_sigar_net_iflist_get): 
[1] 
  net.ifname = lo0, 
  net.config.name = lo0, 
  net.config.type = Local Loopback, 
  net.config.desc = lo0, 
  net.config.address = 127.0.0.1, 
  net.config.destination = 127.0.0.1, 
  net.config.hwaddr = 00:00:00:00:00:00, 
  net.config.broadcast = 0.0.0.0, 
  net.config.netmask = 255.0.0.0, 
  net.config.flags = 32841
  net.config.mtu = 16384
  net.config.metric = 0
  net.stat.rx_packets = 1851280
  net.stat.rx_bytes = 2236416917
  net.stat.rx_errors = 0
  net.stat.rx_dropped = 0
  net.stat.rx_overruns = (undef) 0
  net.stat.rx_frame = (undef) 0
  net.stat.tx_packets = 1851280
  net.stat.tx_bytes = 2236416917
  net.stat.tx_errors = 0
  net.stat.tx_dropped = (undef) 0
  net.stat.tx_overruns = (undef) 0
  net.stat.tx_collisions = 0
  net.stat.tx_carrier = (undef) 0
  net.stat.speed = 0
sigar-test-all.c.697 (0): net::connections = 

<end_of_output>

The problem exists both for the 32bit and the 64bit agent, where the above shown is nearly identical on the 64bit system.   

How to repeat:
- install and start agent on FreeBSD7
[27 May 2009 16:45] Mark Matthews
I get no failures with mysqlmonitoragent-2.1.0.1048-freebsd7-x86-32bit-installer.bin on a FreeBSD install in VMware.
[27 May 2009 22:28] Mark Matthews
Relevent output:

sigar-test-all.c.642 (test_sigar_net_iflist_get):
[0]
  net.ifname = em0,
  net.config.name = em0,
  net.config.type = Ethernet,
  net.config.desc = em0,
  net.config.address = 172.16.86.128,
  net.config.destination = (undef),
  net.config.hwaddr = 00:0C:29:D2:F2:FD,
  net.config.broadcast = 172.16.86.255,
  net.config.netmask = 255.255.255.0,
  net.config.flags = 34883
  net.config.mtu = 1500
  net.config.metric = 0
  net.stat.rx_packets = 9767
  net.stat.rx_bytes = 13133205
  net.stat.rx_errors = 0
  net.stat.rx_dropped = 0
  net.stat.rx_overruns = (undef) 0
  net.stat.rx_frame = (undef) 0
  net.stat.tx_packets = 6020
  net.stat.tx_bytes = 452739
[17 Jun 2009 17:32] Jan Kneschke
... sigar_net_interface_stat_get(em0) failed: 6  means ENXIO 

#define ENXIO           6               /* Device not configured */

looking through the sigar code it seems it ignores:

        if (sdl->sdl_family != AF_LINK) {
            continue;
        }
        if (!((sdl->sdl_type == IFT_ETHER) ||
              (sdl->sdl_type == IFT_LOOP)))
        {
            continue; /* XXX deal w/ other weirdo interfaces */
        }

Looking http://github.com/hyperic/sigar/blob/0008c5611964d6ee1edc9938ebc3b92624a731e1/src/os/darwi... the code has been updated to handle IFT_OTHER if it has a IP address.
[27 Jul 2009 22:15] Enterprise Tools JIRA Robot
Carsten Segieth writes: 
testing 2.1.0.1079 the problem is still present with the same error messages "... failed: 6".
[4 Aug 2009 15:46] Enterprise Tools JIRA Robot
Marcos Palacios writes: 
Tested with agent build 2.1.0.1082. This agent build shows its version as "2.1.0.1079" but you can see that the install directory and the etc/mysql-monitor-agent.ini file have the right version.
It is installed in box "vbox-ua-1-vm1.mysql.com" on directory:
/home/qauser/merlin/agent/2.1.0.1082/freebsd7-x86-32bit/vbox-ua-1-vm1/

The agent can be seen in the dashboard as "59_freebsd7-x86-32_vbox-ua-1-vm1_36044" on http://qa-merlin:38080/Monitor.action

Result:
In the Meta-Info on the dashboard only the localhost address is shown, but not the address that is visible from outside like it is for all other agents.
[4 Aug 2009 20:53] Enterprise Tools JIRA Robot
Jan Kneschke writes: 
in src/os/darwin/darwin_sigar.c line 2562 is:

          case IFMSG_ITER_GET:
            if (strEQ(iter->name, sdl->sdl_data)) {
                iter->data.ifm = ifm;
                return SIGAR_OK;
            }

As the comment above that block says:

   /* sdl_data doesn't include a trailing \0, it is only sdl_nlen long */

which breaks the strEQ() macro which does a strcmp().

Replacing it by:

    while (ptr < end) {
       int len;
       ...
          case IFMSG_ITER_GET:
            len = strlen(iter->name);
            if (len == sdl->sdl_nlen && 0 == memcmp(iter->name, sdl->sdl_data, len)) {

fixes it.

(mail sent to hyperic)

Waiting for it to hit the master-tree so we can merge it back.
[4 Aug 2009 23:23] Enterprise Tools JIRA Robot
Gary Whizin writes: 
didn't make final beta release, moving to gamma
[12 Aug 2009 17:29] Enterprise Tools JIRA Robot
Jan Kneschke writes: 
tracked at hyperic as http://jira.hyperic.com/browse/SIGAR-137
[11 Dec 2009 8:37] Enterprise Tools JIRA Robot
Jan Kneschke writes: 
sigar is updated to a version that should include a fix for it.
[18 Dec 2009 17:09] Enterprise Tools JIRA Robot
Carsten Segieth writes: 
IP address problem solved with 2.1.1.1114, but one of the 2 FreeBSD7 VBox systems now shows 15 CPUs. But this is another problem and will be reported separate.
[14 Jan 2010 14:53] MC Brown
A note has been added to the 2.1.1 changelog: 

The IP address of the agent host on FreeBSD 7 systems would not be reported correctly.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.045 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.