Raspberry Pi

Started by nihplod, July 18, 2012, 04:37:36 AM

Previous topic - Next topic

nihplod

Hi, i have compiled netms 1.2.1 agent on my Raspberry pi and after some tinkering the deamon starts

Problem is now, even though i am using the same cfg file as my other nodes i cannot get any readings from the unit.
I tried to run it with debug 9 just to get all the data from it..

[18-Jul-2012 01:33:46] Additional configs was loaded from /etc/nxagentd.conf.d
[18-Jul-2012 01:33:46] Debug level set to 9
[18-Jul-2012 01:33:46] Failed to load agent's registry from file /var/opt/netxms/agent/registry.dat
[18-Jul-2012 01:33:46] Failed to save agent's registry to file /var/opt/netxms/agent/registry.dat: No such file or directory
[18-Jul-2012 01:33:46] Subagent API initialized
[18-Jul-2012 01:33:47] Linux: using /sys/block to distinguish devices from partitions
[18-Jul-2012 01:33:47] Subagent "/usr/local/lib/libnsm_linux.so" loaded successfully
[18-Jul-2012 01:33:47] Unable to parse /proc/drbd, DRBD data collector will not start
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram0 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram1 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram2 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram3 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram4 isRealDevice=1)
[18-Jul-2012 01:33:47] Debug callback set for DB library
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram5 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram6 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram7 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram8 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram9 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram10 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram11 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram12 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram13 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram14 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=ram15 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=loop0 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=loop1 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=loop2 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=loop3 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=loop4 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=loop5 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=loop6 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=loop7 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=mmcblk0 isRealDevice=1)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=mmcblk0p1 isRealDevice=0)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=mmcblk0p2 isRealDevice=0)
[18-Jul-2012 01:33:47] ParseIoStat(): new device added (name=mmcblk0p3 isRealDevice=0)
[18-Jul-2012 01:33:48] External parameters providers poller thread will not start
[18-Jul-2012 01:33:48] Trying to bind on 0.0.0.0:4700
[18-Jul-2012 01:33:48] Listening on socket 0.0.0.0:4700
[18-Jul-2012 01:33:49] EXEC: Expanding command ""/usr/local/bin/nxagentd" -c "/etc/nxagentd.conf" -D 9 -W 19677"
[18-Jul-2012 01:33:49] EXEC: Executing ""/usr/local/bin/nxagentd" -c "/etc/nxagentd.conf" -D 9 -W 19677"
[18-Jul-2012 01:33:49] Watchdog process started
[18-Jul-2012 01:33:49] NetXMS Agent started
Agent running. Press Ctrl+C to shutdown.
[18-Jul-2012 01:34:23] Incoming connection from 10.0.0.18
[18-Jul-2012 01:34:23] Connection from 10.0.0.18 accepted
[18-Jul-2012 01:34:23] [session:0] Received control message CMD_GET_NXCP_CAPS
[18-Jul-2012 01:34:23] [session:0] Sending message CMD_NXCP_CAPS (size 16)
[18-Jul-2012 01:34:23] [session:0] Received message CMD_AUTHENTICATE
[18-Jul-2012 01:34:23] [session:0] Sending message CMD_REQUEST_COMPLETED (size 32)
[18-Jul-2012 01:34:23] [session:0] Received message CMD_REQUEST_SESSION_KEY
[18-Jul-2012 01:34:23] [session:0] Sending message CMD_SESSION_KEY (size 32)
[18-Jul-2012 01:34:23] [session:0] Session with 10.0.0.18 closed


The last 8 rows is the connection from my NetXMS server and that is the only thing that happens, nothing more nothing less.
Any idea what is missing?

Victor Kirhenshtein

Hi!

Looks like encryption is now working for some reason, because server drops connection immediately after key exchange. Can you check server logs as well? Also, try to disable encryption in agent to ensure that it's encryption problem.

Best regards,
Victor

nihplod

If i disable the encryption in the agent and then tries to connect after done the changes in NetXMS console i get this result

[18-Jul-2012 09:40:04] Connection from 10.0.0.18 accepted
[18-Jul-2012 09:40:04] [session:0] Received control message CMD_GET_NXCP_CAPS
[18-Jul-2012 09:40:04] [session:0] Sending message CMD_NXCP_CAPS (size 16)
[18-Jul-2012 09:40:04] [session:0] Received message CMD_KEEPALIVE
[18-Jul-2012 09:40:04] [session:0] Sending message CMD_REQUEST_COMPLETED (size 32)
[18-Jul-2012 09:40:04] [session:0] Session with 10.0.0.18 closed


And the only thing i can see on NetXMS server is this
[18-Jul-2012 11:40:02] Starting configuration poll for node Pi (ID: 299)
[18-Jul-2012 11:40:02] ConfPoll(Pi): checking for NetXMS agent Flags={01000000} DynamicFlags={00000400}
[18-Jul-2012 11:40:02] ConfPoll(Pi): checking for NetXMS agent - connecting
[18-Jul-2012 11:40:02] ConfPoll(Pi): checking for NetXMS agent - failed to connect
[18-Jul-2012 11:40:02] ConfPoll(Pi): checking for NetXMS agent - finished
[18-Jul-2012 11:40:02] ConfPoll(Pi): checking for CheckPoint SNMP on port 260
[18-Jul-2012 11:40:10] Node::deleteInterface(node=Pi [299], interface=unknown [310])
[18-Jul-2012 11:40:10] Node::deleteInterface(node=Pi [299], interface=unknown [310]): unlinked from subnet 10.0.0.0/24 [102]
[18-Jul-2012 11:40:10] Deleting object 310 [unknown]
[18-Jul-2012 11:40:10] NetObj::Delete(): clearing parent list for object 310
[18-Jul-2012 11:40:10] NetObj::Delete(): clearing child list for object 310
[18-Jul-2012 11:40:10] NetObj::Delete(): deleting object 310 from indexes
[18-Jul-2012 11:40:10] NetObj::Delete(): calling OnObjectDelete(310)
[18-Jul-2012 11:40:10] Object 310 successfully deleted
[18-Jul-2012 11:40:10] Node::createNewInterface(0A000016, 00000000, (null), 0, 0, bp=0, slot=0, port=0) called for node Pi [299]
[18-Jul-2012 11:40:10] Node::createNewInterface: node=Pi [299] cluster=(null) [0] add=1
[18-Jul-2012 11:40:10] Finished configuration poll for node Pi (ID: 299)
[18-Jul-2012 11:40:10] EVENT 16 (ID:8343 F:0x0001 S:0 TAG:"") FROM Pi: Interface "unknown" deleted (IP Addr: 10.0.0.22/255.255.255.0, IfIndex: 1)
[18-Jul-2012 11:40:10] EVENT 11 (ID:8344 F:0x0001 S:0 TAG:"") FROM Pi: Node status changed to UNKNOWN
[18-Jul-2012 11:40:10] EVENT 3 (ID:8345 F:0x0001 S:0 TAG:"") FROM Pi: Interface "unknown" added (IP Addr: 10.0.0.22/255.255.255.0, IfIndex: 1)
[18-Jul-2012 11:40:10] Starting status poll for node Switch (ID: 104)
[18-Jul-2012 11:40:11] AccountStatusUpdater: wakeup
[18-Jul-2012 11:40:11] Finished status poll for node Switch (ID: 104)
[18-Jul-2012 11:40:15] Starting configuration poll for node Minecraft (ID: 133)
[18-Jul-2012 11:40:15] ConfPoll(Minecraft): checking for NetXMS agent Flags={08000002} DynamicFlags={00001002}
[18-Jul-2012 11:40:15] ConfPoll(Minecraft): checking for NetXMS agent - connecting
[18-Jul-2012 11:40:15] ConfPoll(Minecraft): checking for NetXMS agent - connected
[18-Jul-2012 11:40:15] ConfPoll(Minecraft): checking for NetXMS agent - finished
[18-Jul-2012 11:40:15] ConfPoll(Minecraft): calling SnmpCheckCommSettings()
[18-Jul-2012 11:40:15] SnmpCheckV3CommSettings: failed
[18-Jul-2012 11:40:15] SnmpCheckCommSettings: trying version 1 community 'public'
[18-Jul-2012 11:40:19] * Syncer * Unable to delete object with id 310 because it is being referenced 1 time(s)


Where do i need to dig to find something more?

Victor Kirhenshtein

How did you compile agent for Pi? Can you send me config.h from your build? I suspect wrong byte order detection.

Best regards,
Victor

nihplod

tried
sudo sh configure --with-agent
and
sudo sh configure --with-agent --libdir=/usr/lib

Cause there was first some lib errors, but that was solved with the libdir i think. I also moved all the libs to /usr/lib that was for nxagent first compile also cause it wasn't looking in /usr/local/lib apparently.

attached config.h, the output from configure, the output from make and the output from make install

nihplod

Any idea about what i could do about this?

Victor Kirhenshtein

You can try to rebuild agent with --disable-iconv option. If this will not help, can you consider giving me shell access to it so I can debug the issue?

Best regards,
Victor

nihplod

I tried to rebuild it with that flag but it seems i have the same issue.

I sent you logindata and stuff for the unit.
Just use sudo for root stuff. Dont break the small baby :P

Victor Kirhenshtein

Hi!

Just try to connect to agent via ssh port forwarding - it responds correctly. I see in your config that you turn on authentication on agent - but do you enter correct authentication parameters in node properties? Currently everything is correct in my test:


C:\Source\NetXMS\x64\debug>nxget -e 0 -p 4444 -a sha1 -s <secret> 127.0.0.1 Agent.Version
1.2.1


and on the agent:


[31-Jul-2012 19:16:26] Incoming connection from 127.0.0.1
[31-Jul-2012 19:16:26] Connection from 127.0.0.1 accepted
[31-Jul-2012 19:16:26] [session:0] Received control message CMD_GET_NXCP_CAPS
[31-Jul-2012 19:16:26] [session:0] Sending message CMD_NXCP_CAPS (size 16)
[31-Jul-2012 19:16:26] [session:0] Received message CMD_AUTHENTICATE
[31-Jul-2012 19:16:26] [session:0] Sending message CMD_REQUEST_COMPLETED (size 32)
[31-Jul-2012 19:16:26] [session:0] Received message CMD_KEEPALIVE
[31-Jul-2012 19:16:26] [session:0] Sending message CMD_REQUEST_COMPLETED (size 32)
[31-Jul-2012 19:16:26] [session:0] Received message CMD_GET_PARAMETER
[31-Jul-2012 19:16:26] [session:0] Requesting parameter "Agent.Version"
[31-Jul-2012 19:16:26] [session:0] GetParameterValue(): result is 0 (SUCCESS)
[31-Jul-2012 19:16:26] [session:0] Sending message CMD_REQUEST_COMPLETED (size 56)
[31-Jul-2012 19:16:26] [session:0] Session with 127.0.0.1 closed


Best regards,
Victor

nihplod

Yeah, it seems that it wont work when i have authentication running.
I have the same configuration as the other nodes and it will just halt when doing a poll, but if i comment out the authentication it will work. And i am using the very same settings that i've done for the other nodes that has working auth.

Thanks for the help tho =)

Victor Kirhenshtein

Can you show me screenshot of authentication properties in console for this node? nxget works fine with authentication, so server should also work.

Best regards,
Victor

nihplod

I have tried with None, Plain text, md5 and sha1. But when i remove encryption from configuration file and restarts it works properly.

This is the result when i try accessing with the client using any setting when having force encryption activated on the node
[01-Aug-2012 09:12:21] Connection from 10.0.0.18 accepted
[01-Aug-2012 09:12:21] [session:0] Received control message CMD_GET_NXCP_CAPS
[01-Aug-2012 09:12:21] [session:0] Sending message CMD_NXCP_CAPS (size 16)
[01-Aug-2012 09:12:21] [session:0] Received message CMD_AUTHENTICATE
[01-Aug-2012 09:12:21] [session:0] Sending message CMD_REQUEST_COMPLETED (size 32)
[01-Aug-2012 09:12:21] [session:0] Received message CMD_REQUEST_SESSION_KEY
[01-Aug-2012 09:12:21] [session:0] Sending message CMD_SESSION_KEY (size 32)
[01-Aug-2012 09:12:21] [session:0] Session with 10.0.0.18 closed

Victor Kirhenshtein

But do you build agent with encryption enabled? I remember that on some stage of debugging you was rebuilding it without encryption.

nihplod

It is built with --disable-iconv now, that is the only disable i have. Encryption isn't that important for me on my own private network at home. I can communicate with the node so it's not an issue now ^^