Difference between revisions of "From src"

828 bytes added ,  18:13, 13 September 2022
m
Text replacement - "^" to "{{deprecated}}"
m (git connect added)
m (Text replacement - "^" to "{{deprecated}}")
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=Get git latest snapshot=
{{deprecated}}=System=
install git
To work in /usr/local directory you need rights of group staff
  apt-get install git
  sudo adduser User staff


crate local copy of repo
Recomended to use git to get latest data.
  git clone git://git.netxms.org/public/netxms.git netxms-git
  sudo apt-get install git


reconfig
=Latest snapshot=
cd netxms-git
Create local copy of repository (recommended)
./reconf
<pre>
cd /usr/local/src/
git clone git://git.netxms.org/public/netxms.git netxms-git
</pre>


=Debian 7.4 + MySQL=
Or you can get latest snapshot from website
Using netxms-1.2.12.tar.gz
<pre>
 
wget http://git.netxms.org/netxms-snapshot-develop.tar.gz
Give rights to create local software
mkdir -p /usr/local/src/netxms-git
sudo adduser YourUser staff
cp netxms-snapshot-develop.tar.gz /usr/local/src/netxms-git
cd /usr/local/src/netxms-git
tar -xf netxms-snapshot-develop.tar.gz
</pre>


=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
 
Copy last version of src package to local folder, unpack:
cp netxms-1.2.12.tar.gz /usr/local/src/
  tar -xf netxms-1.2.12.tar.gz
 
Configure & make:
  ./configure --with-server --with-agent --with-mysql --enable-unicode
  ./configure --with-server --with-agent --with-mysql --enable-unicode
  make
  make
  make install
  make install


Copy to /etc
May be some troubles with libraries
  sudo cp contrib/netxmsd.conf-dist /etc/netxmsd.conf
  cd /usr/local/lib
  sudo cp contrib/nxagentd.conf-dist /etc/nxagentd.conf
  sudo ldconfig
 
Edit server config file:


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


/etc/nxagentd.conf
/etc/netxmsd.conf
  LogFile = {syslog}
  DBDriver = /usr/local/lib/libnxddr_mysql.so
  Servers = localhost
  DBServer = localhost
DBName = netxms
DBLogin = netxms
DBPassword = password
LogFile = /var/log/netxms


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


=Debian 7 + oracle=
=Debian 7 + oracle=
Using git hourly snapshot
Give rights to create local software
sudo adduser YourUser staff


Prepare environment:
Prepare environment:
  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 85: Line 83:
  sudo ldconfig
  sudo ldconfig


===Main process===
===Configure & make===
Get latest git-snapshot:
  cd /usr/local/src/netxms-git
  wget http://git.netxms.org/netxms-snapshot.tar.gz
./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


move to workdir
Edit /etc/netxmsd.conf
mkdir -p /usr/local/src/netxms-git
<pre>
cp netxms-snapshot.tar.gz /usr/local/src/netxms-git
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>


Extract files
===Oracle database===
  cd /usr/local/src/netxms-git/
<pre>
tar -xf netxms-snapshot.tar.gz
-- 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


Configure & compile
=Change agent config=
.reconf
Copy to /etc
  ./configure --enable-unicode --with-agent --with-oracle=/usr/local/lib/instantclient_11_2/ --with-server --with-snmp
  sudo cp /usr/local/src/netxms-git/contrib/nxagentd.conf-dist /etc/nxagentd.conf
make
make install


Make startup configuration as described above (Debian 7 + Mysql)
/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