Agent configuration file problem in NetXMS version 2.6.300

Started by jbriseno, December 04, 2020, 09:16:54 PM

Previous topic - Next topic

jbriseno

Hey, there. I just installed the latest version of NetXMS server and netxms agent, in this case Linux agent on Ubuntu 18.04

With this in mind I decided to add the the Sample agent's configuration file in the nxagentd.conf

I stopped the netXMS server and I restarted. However, I could not to connect to the server. The Desktop Managment tool sent back the following popup window (I attach a screenshot). I checked the status of netXMS server out. In the terminal window sent back the following error.

sudo systemctl status netxmsd
%u25CF netxmsd.service - NetXMS Server
   Loaded: loaded (/lib/systemd/system/netxmsd.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2020-12-04 19:03:26 UTC; 6s ago
  Process: 1560 ExecStart=/usr/bin/netxmsd -d (code=exited, status=0/SUCCESS)
Main PID: 1570 (code=exited, status=3)

Dec 04 19:03:26 hpserver1 systemd[1]: Starting NetXMS Server...
Dec 04 19:03:26 hpserver1 systemd[1]: Started NetXMS Server.
Dec 04 19:03:26 hpserver1 systemd[1]: netxmsd.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED
Dec 04 19:03:26 hpserver1 systemd[1]: netxmsd.service: Failed with result 'exit-code'.


Finally, I checked the netXMS server log file out. I attach the latest lines.

2020.12.04 16:43:18.937 *I* [logger             ] Log file opened (rotation policy 2, max size 4194304)
2020.12.04 16:43:18.937 *I* [logger             ] Log rotation policy set to 2 (size=16777216, count=4)
2020.12.04 16:43:18.937 *I* [                   ] Core agent version 3.6-300-g287f599693
2020.12.04 16:43:18.937 *I* [                   ] Additional configuration files was loaded from /etc/nxagentd.conf.d
2020.12.04 16:43:18.937 *I* [logger             ] Debug level set to 0
2020.12.04 16:43:18.937 *I* [                   ] Data directory: /var/lib/netxms
2020.12.04 16:43:18.937 *I* [                   ] File store: /tmp
2020.12.04 16:43:18.940 *I* [crypto             ] Crypto library initialized (OpenSSL 1.1.1g  21 Apr 2020)
2020.12.04 16:43:18.940 *W* [crypto             ] Compile time OpenSSL version (1010100f) does not match runtime OpenSSL version (1010107f)
2020.12.04 16:43:18.941 *I* [db.drv             ] Database driver "sqlite.ddr" loaded and initialized successfully
2020.12.04 16:43:18.992 *I* [db.agent           ] Local database opened successfully
2020.12.04 16:43:18.992 *I* [                   ] Agent ID is 9dd1fc5d-9890-4a44-9100-022dce11e744
2020.12.04 16:43:18.993 *I* [                   ] Local host name is "localhost.localdomain"
2020.12.04 16:43:18.993 *I* [                   ] Using system name "hpserver1"
2020.12.04 16:43:18.994 *I* [                   ] Arbitrary command execution disabled
2020.12.04 16:43:20.004 *I* [                   ] Subagent "Linux" (linux.nsm) loaded successfully (version 3.6.300)
2020.12.04 16:43:20.004 *I* [                   ] System hardware ID is 4DB3FBE746CC2A3B0331140CD3F1872F15594097
2020.12.04 16:43:21.005 *I* [                   ] Listening on socket 0.0.0.0:4700
2020.12.04 16:43:21.005 *I* [                   ] Listening on socket :::4700
2020.12.04 16:43:22.007 *I* [                   ] NetXMS Agent started

Any idea how to fix it?

Thanks in advance

Alex Kirhenshtein

Quote from: jbriseno on December 04, 2020, 09:16:54 PM
Finally, I check the netXMS server log file. I attach the latest lines.

2020.12.04 16:43:18.937 *I* [logger             ] Log file opened (rotation policy 2, max size 4194304)
2020.12.04 16:43:18.937 *I* [logger             ] Log rotation policy set to 2 (size=16777216, count=4)
2020.12.04 16:43:18.937 *I* [                   ] Core agent version 3.6-300-g287f599693
2020.12.04 16:43:18.937 *I* [                   ] Additional configuration files was loaded from /etc/nxagentd.conf.d
2020.12.04 16:43:18.937 *I* [logger             ] Debug level set to 0
...


that's agent log file, not server.

jbriseno

Hi, Alex I appreciate your help. Your right.

the latest lines of the netxmsd log file

2020.12.04 18:54:42.196 *I* [logger             ] Log file opened (rotation policy 2, max size 16777216)
2020.12.04 18:54:42.212 *I* [                   ] Code page set to ISO8859-1
2020.12.04 18:54:42.212 *E* [                   ] Cannot load platform subagent "/usr/local/lib/netxms/linux.nsm" (/usr/local/lib/netxms/linux.nsm: cannot open shared object file: No such file or directory)
2020.12.04 18:54:42.212 *E* [db.drv             ] Unable to load database driver module "mysql.ddr": /usr/local/lib/netxms/dbdrv/mysql.ddr: cannot open shared object file: No such file or directory

Filipp Sudanov

try starting netxmsd process from command prompt in foregroud mode:

netxmsd -D 6

This will start it with 6-th level or debug and will put all messages that are written to log file to the console. After it terminates, share the output.

jbriseno

Hi, Filipp I appreciate your sooner reply to my post.

netxmsd -D 6
Using configuration file "/etc/netxmsd.conf"
FATAL ERROR: Cannot open log file

But the netxmsd.conf file is in the /etc directory

ls -la /etc/netxmsd.conf
-rw-r--r-- 1 root root 812 Dec  4 20:00 /etc/netxmsd.conf


Filipp Sudanov

It's ok with /etc/netxmsd.conf - it's just printing what config file it's using. The error is "FATAL ERROR: Cannot open log file".

I can think of two reasons for that:
- you are starting it as regular user, but the log file was previously opened by netxms running under root (because systemd lauches it this way). So under regular user you don't have rights to write to same log file. Try running under root user.
- check log file configuration in /etc/netxmsd.conf. Does it point to non-existing folder?

jbriseno

Hi, Filipp. I ran the netXMS server under root user:

root@hpserver1:~# systemctl start netxmsd
root@hpserver1:~# systemctl status netxmsd
● netxmsd.service - NetXMS Server
   Loaded: loaded (/lib/systemd/system/netxmsd.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2020-12-04 23:12:57 UTC; 7s ago
  Process: 9502 ExecStart=/usr/bin/netxmsd -d (code=exited, status=0/SUCCESS)
Main PID: 9510 (code=exited, status=3)

Dec 04 23:12:57 hpserver1 systemd[1]: Starting NetXMS Server...
Dec 04 23:12:57 hpserver1 systemd[1]: Started NetXMS Server.
Dec 04 23:12:57 hpserver1 systemd[1]: netxmsd.service: Main process exited, code=exited, status=3/NOTIMPLEMENT
Dec 04 23:12:57 hpserver1 systemd[1]: netxmsd.service: Failed with result 'exit-code'.

The first lines of the netxmsd.conf file

## Logging
# Log file name
LogFile=/var/log/netxmsd


# Increase logging verbosity, 0 (only errors) to 9 (verbose debug)
#DebugLevel=3

## Database configuration.
## Uncomment and setup ONE section.

## Option #1 - SQLite (for test installations only):
#DBDriver=sqlite.ddr
#DBName=/var/lib/netxms/netxms.db

Nothing to point to the non-existing folder.


Filipp Sudanov

try deleting /var/log/netxmsd and running
netxmsd -D 6
again.
Wil the error be the same?

jbriseno

Hi, Filipp

I deleted the /var/log/netxmsd file

josemb@hpserver1:~$ netxmsd -D 6
Using configuration file "/etc/netxmsd.conf"
FATAL ERROR: Cannot open log file

Alex Kirhenshtein

You are running netxmsd as user "josemb" which does not have write access to /var/log.
Either run netxmsd as root, or change configuration file location.

Quote from: jbriseno on December 05, 2020, 02:02:33 AM
Hi, Filipp

I deleted the /var/log/netxmsd file

josemb@hpserver1:~$ netxmsd -D 6
Using configuration file "/etc/netxmsd.conf"
FATAL ERROR: Cannot open log file

jbriseno

Hi, Alex I appreciate your time to help me. I repeated the Filipp procedure as root user. The computer screen sent the following messages:

root@hpserver1:/var/log# rm netxmsd.log
root@hpserver1:/var/log# cd
root@hpserver1:~# netxmsd -D 6
Using configuration file "/etc/netxmsd.conf"
2020.12.05 12:56:36.873 *D* [                   ] LIB directory set to /usr/local/lib/netxms
2020.12.05 12:56:36.874 *I* [                   ] Code page set to ISO8859-1
2020.12.05 12:56:36.874 *E* [                   ] Cannot load platform subagent "/usr/local/lib/netxms/linux.nsm" (/usr/local/lib/netxms/linux.nsm: cannot open shared object file: No such file or directory)
2020.12.05 12:56:36.874 *E* [db.drv             ] Unable to load database driver module "mysql.ddr": /usr/local/lib/netxms/dbdrv/mysql.ddr: cannot open shared object file: No such file or directory

The content of the netxmsd.conf file

# Logging
# Log file name
LogFile=/var/log/netxmsd


# Increase logging verbosity, 0 (only errors) to 9 (verbose debug)
#DebugLevel=3

## Database configuration.
## Uncomment and setup ONE section.

## Option #1 - SQLite (for test installations only):
#DBDriver=sqlite.ddr
#DBName=/var/lib/netxms/netxms.db

## Option #2 - PostgreSQL (recommended):
#DBDriver=pgsql.ddr
#DBServer=127.0.0.1
#DBName=netxms
#DBLogin=netxms
#DBPassword=netxms

##Option #3 - MySQL:
DBDriver=mysql.ddr
DBServer=localhost
DBName=netxms
DBLogin=############
DBPassword=########

## Option #4 - Oracle:
#DBDriver=oracle.ddr
#DBServer=//127.0.0.1:1521/ORCL # Instant Client connection string or SID
#DBLogin=netxms
#DBPassword=netxms

## Option #5 - unixODBC/FreeTDS:
#DBDriver=odbc.ddr
#DBServer=NETXMS_DSN
#DBLogin=netxms
#DBPassword=netxms

Thanks in Advance

Alex Kirhenshtein

According to systemctl output, netxms is installed in /usr, but it tries to load modules from /usr/local/bin - this looks like you mixed binaries from different versions.
I recommend to clean both versions, then configure and make install again.

Which distro do you use?

jbriseno

Hi, Alex. I am using Ubuntu server 18.04. Question: How can I clean both versions?
Thanks in advance.

Filipp Sudanov

I would do the following way:
apt remove "netxms*"

Then find and delete the following files on the file system:
libnx*
libnetxms*

And then install netxms again - install  netxms-release package and then netxms-server, netxms-agent and database driver package.

jbriseno

Hi, Filipp. Thanks for your sooner reply to my post. I have a Database question: we have a current netXMS database. With this in mind. Do I do

nxdbmgr upgrade or

nxdbmgr init

Thanks in advance

Jose