Difference between revisions of "From src"

From NetXMS Wiki
Jump to navigation Jump to search
m (Text replacement - "^" to "{{deprecated}}")
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=System=
{{deprecated}}=System=
To work in /usr/local directory you need rights of group staff
To work in /usr/local directory you need rights of group staff
  sudo adduser User staff
  sudo adduser User staff
Line 7: Line 7:


=Latest snapshot=
=Latest snapshot=
Create local copy of repository
Create local copy of repository (recommended)
<pre>
<pre>
cd /usr/local/src/
cd /usr/local/src/
Line 15: Line 15:
Or you can get latest snapshot from website
Or you can get latest snapshot from website
<pre>
<pre>
wget http://git.netxms.org/netxms-snapshot.tar.gz
wget http://git.netxms.org/netxms-snapshot-develop.tar.gz
mkdir -p /usr/local/src/netxms-git
mkdir -p /usr/local/src/netxms-git
cp netxms-snapshot.tar.gz /usr/local/src/netxms-git
cp netxms-snapshot-develop.tar.gz /usr/local/src/netxms-git
cd /usr/local/src/netxms-git
cd /usr/local/src/netxms-git
tar -xf netxms-snapshot.tar.gz
tar -xf netxms-snapshot-develop.tar.gz
</pre>
</pre>


=Debian 7.4 + MySQL=
=Debian 7 + MySQL=
Prepare environment:
Prepare environment:
  sudo apt-get install build-essential flex bison libssl-dev libmysqlclient-dev mysql-server
  sudo apt-get install build-essential flex bison libssl-dev libmysqlclient-dev mysql-server


Prepare database
===Configure & make===
  mysql -u root -p
  cd /usr/local/src/netxms-git
  CREATE DATABASE netxms;
  ./reconf
GRANT ALL ON netxms.* TO netxms@localhost IDENTIFIED BY 'password';
\q
 
Configure & make:
  ./configure --with-server --with-agent --with-mysql --enable-unicode
  ./configure --with-server --with-agent --with-mysql --enable-unicode
  make
  make
Line 41: Line 37:
  sudo ldconfig
  sudo ldconfig


Copy to /etc
Edit server config file:
sudo cp contrib/netxmsd.conf-dist /etc/netxmsd.conf
sudo cp contrib/nxagentd.conf-dist /etc/nxagentd.conf


Edit config files:
sudo cp /usr/local/src/netxms-git/contrib/netxmsd.conf-dist /etc/netxmsd.conf


/etc/netxmsd.conf
/etc/netxmsd.conf
Line 55: Line 49:
  LogFile = /var/log/netxms
  LogFile = /var/log/netxms


/etc/nxagentd.conf
===MySQL database===
  LogFile = {syslog}
  mysql -u root -p
  Servers = localhost
  CREATE DATABASE netxms;
 
  GRANT ALL ON netxms.* TO netxms@localhost IDENTIFIED BY 'password';
Configure startup scripts
  \q
  cd /usr/local/src/netxms-1.2.12/contrib/startup/debian/
create initial shema
  sudo cp netxmsd /etc/init.d/
  nxdbmgr init /usr/local/share/netxms/sql/dbinit_mysql.sql
  sudo cp nxagentd /etc/init.d/
sudo chmod u+x /etc/init.d/nxagentd
sudo chmod u+x /etc/init.d/netxmsd
sudo update-rc.d nxagentd defaults
sudo update-rc.d netxmsd defaults


=Debian 7 + oracle=
=Debian 7 + oracle=
Line 73: Line 62:
  sudo apt-get install build-essential flex bison libssl-dev autoconf libtool unzip libaio-dev
  sudo apt-get install build-essential flex bison libssl-dev autoconf libtool unzip libaio-dev


===Install oracle driver libs===
===Oracle libs===
Get oracle libs from site: [http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html | oracle]
Get oracle libs from site: [http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html | oracle]
  instantclient-basic-linux.x64-11.2.0.4.0.zip
  instantclient-basic-linux.x64-11.2.0.4.0.zip
Line 94: Line 83:
  sudo ldconfig
  sudo ldconfig


Configure & compile
===Configure & make===
  cd /usr/local/src/netxms-git
  cd /usr/local/src/netxms-git
  .reconf
  ./reconf
  ./configure --enable-unicode --with-agent --with-oracle=/usr/local/lib/instantclient_11_2/ --with-server --with-snmp
  ./configure --enable-unicode --with-agent --with-oracle=/usr/local/lib/instantclient_11_2/ --with-server --with-snmp
  make
  make
Line 105: Line 94:
  sudo ldconfig
  sudo ldconfig


Make startup configuration as described above (Debian 7 + Mysql)
Edit /etc/netxmsd.conf
<pre>
DBDriver = /usr/local/lib/netxms/dbdrv/oracle.ddr
DBServer = ServerIP/'''ServerName.DomaiNname''' #Here is service (full database name), not SID
DBName = netxms
DBLogin = netxms
DBPassword = PaSwD
</pre>
 
===Oracle database===
<pre>
-- USER SQL
CREATE USER netxms IDENTIFIED BY PaSwD
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP;
-- QUOTAS
ALTER USER netxms QUOTA UNLIMITED ON USERS;
-- ROLES
GRANT CREATE SESSION, CREATE TABLE, CREATE PROCEDURE TO netxms;
</pre>
create initial schema
nxdbmgr init /usr/local/share/netxms/sql/dbinit_oracle.sql
 
=Change agent config=
Copy to /etc
sudo cp /usr/local/src/netxms-git/contrib/nxagentd.conf-dist /etc/nxagentd.conf
 
/etc/nxagentd.conf
LogFile = {syslog}
Servers = localhost


Prepare database as described: [[Oracle]]
=Startup scripts=
Configure startup scripts
cd /usr/local/src/netxms-git/contrib/startup/debian/
sudo cp netxmsd /etc/init.d/
sudo cp nxagentd /etc/init.d/
sudo chmod u+x /etc/init.d/nxagentd
sudo chmod u+x /etc/init.d/netxmsd
sudo update-rc.d nxagentd defaults
sudo update-rc.d netxmsd defaults

Latest revision as of 16:13, 13 September 2022

This Wiki is deprecated and we are are currrently migrating remaining pages into product documentation (Admin Guide, NXSL Guide)

=System=

To work in /usr/local directory you need rights of group staff

sudo adduser User staff

Recomended to use git to get latest data.

sudo apt-get install git

Latest snapshot

Create local copy of repository (recommended)

cd /usr/local/src/
git clone git://git.netxms.org/public/netxms.git netxms-git

Or you can get latest snapshot from website

wget http://git.netxms.org/netxms-snapshot-develop.tar.gz
mkdir -p /usr/local/src/netxms-git
cp netxms-snapshot-develop.tar.gz /usr/local/src/netxms-git
cd /usr/local/src/netxms-git
tar -xf netxms-snapshot-develop.tar.gz

Debian 7 + MySQL

Prepare environment:

sudo apt-get install build-essential flex bison libssl-dev libmysqlclient-dev mysql-server

Configure & make

cd /usr/local/src/netxms-git
./reconf
./configure --with-server --with-agent --with-mysql --enable-unicode
make
make install

May be some troubles with libraries

cd /usr/local/lib
sudo ldconfig

Edit server config file:

sudo cp /usr/local/src/netxms-git/contrib/netxmsd.conf-dist /etc/netxmsd.conf

/etc/netxmsd.conf

DBDriver = /usr/local/lib/libnxddr_mysql.so
DBServer = localhost
DBName = netxms
DBLogin = netxms
DBPassword = password
LogFile = /var/log/netxms

MySQL database

mysql -u root -p
CREATE DATABASE netxms;
GRANT ALL ON netxms.* TO netxms@localhost IDENTIFIED BY 'password';
\q

create initial shema

nxdbmgr init /usr/local/share/netxms/sql/dbinit_mysql.sql

Debian 7 + oracle

Prepare environment:

sudo apt-get install build-essential flex bison libssl-dev autoconf libtool unzip libaio-dev

Oracle libs

Get oracle libs from site: | oracle

instantclient-basic-linux.x64-11.2.0.4.0.zip
instantclient-sdk-linux.x64-11.2.0.4.0.zip

Unzip files:

unzip instantclient-basic-linux.x64-11.2.0.4.0.zip
unzip instantclient-sdk-linux.x64-11.2.0.4.0.zip

Copy to workdir:

cp -R instantclient_11_2/ /usr/local/lib/

Link one of needed libs:

cd /usr/local/lib/instantclient_11_2/
ln -s libclntsh.so.11.1 libclntsh.so

Link all libs to be accesed globaly

cd /usr/local/lib/
ln -s instantclient_11_2/lib* ./
sudo ldconfig

Configure & make

cd /usr/local/src/netxms-git
./reconf
./configure --enable-unicode --with-agent --with-oracle=/usr/local/lib/instantclient_11_2/ --with-server --with-snmp
make
make install

May be some troubles with libraries

cd /usr/local/lib
sudo ldconfig

Edit /etc/netxmsd.conf

DBDriver = /usr/local/lib/netxms/dbdrv/oracle.ddr
DBServer = ServerIP/'''ServerName.DomaiNname''' #Here is service (full database name), not SID
DBName = netxms
DBLogin = netxms
DBPassword = PaSwD

Oracle database

-- USER SQL
CREATE USER netxms IDENTIFIED BY PaSwD 
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP;
-- QUOTAS
ALTER USER netxms QUOTA UNLIMITED ON USERS;
-- ROLES
GRANT CREATE SESSION, CREATE TABLE, CREATE PROCEDURE TO netxms;

create initial schema

nxdbmgr init /usr/local/share/netxms/sql/dbinit_oracle.sql

Change agent config

Copy to /etc

sudo cp /usr/local/src/netxms-git/contrib/nxagentd.conf-dist /etc/nxagentd.conf

/etc/nxagentd.conf

LogFile = {syslog}
Servers = localhost

Startup scripts

Configure startup scripts

cd /usr/local/src/netxms-git/contrib/startup/debian/
sudo cp netxmsd /etc/init.d/
sudo cp nxagentd /etc/init.d/
sudo chmod u+x /etc/init.d/nxagentd
sudo chmod u+x /etc/init.d/netxmsd
sudo update-rc.d nxagentd defaults
sudo update-rc.d netxmsd defaults