ScanCore: Difference between revisions

From Alteeve Wiki
Jump to navigation Jump to search
(Created page with "{{howto_header}} {{warning|1=This is little more that raw notes, do not consider anything here to be valid or accurate at this time.}} = Installing = {{footer}}")
 
Line 5: Line 5:
= Installing =
= Installing =


== Database Setup ==
<syntaxhighlight lang="bash">
yum install -y postgresql postgresql-server postgresql-plperl postgresql-contrib postgresql-libs git
</syntaxhighlight>
<syntaxhighlight lang="text">
...
Complete!
</syntaxhighlight>
DB config:
<syntaxhighlight lang="bash">
/etc/init.d/postgresql initdb
</syntaxhighlight>
<syntaxhighlight lang="text">
Initializing database:                                    [  OK  ]
</syntaxhighlight>
Start
<syntaxhighlight lang="bash">
/etc/init.d/postgresql start
</syntaxhighlight>
<syntaxhighlight lang="text">
Starting postgresql service:                              [  OK  ]
</syntaxhighlight>
Set 'postgres' user password>
Configure access
<syntaxhighlight lang="bash">
cp /var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf.striker
vim /var/lib/pgsql/data/pg_hba.conf
diff -u /var/lib/pgsql/data/pg_hba.conf.striker /var/lib/pgsql/data/pg_hba.conf
</syntaxhighlight>
<syntaxhighlight lang="diff">
--- /var/lib/pgsql/data/pg_hba.conf.striker 2015-01-16 15:24:38.985895621 -0500
+++ /var/lib/pgsql/data/pg_hba.conf 2015-01-16 15:26:42.611236927 -0500
@@ -65,9 +65,13 @@
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
+# dashboards
+host    all        all        10.20.4.0/24          md5
+# node servers
+host    all        all        10.20.70.0/24        md5
# "local" is for Unix domain socket connections only
-local  all        all                              ident
+local  all        all                              md5
# IPv4 local connections:
host    all        all        127.0.0.1/32          ident
# IPv6 local connections:
</syntaxhighlight>
<syntaxhighlight lang="bash">
cp /var/lib/pgsql/data/postgresql.conf /var/lib/pgsql/data/postgresql.conf.striker
vim /var/lib/pgsql/data/postgresql.conf
diff -u /var/lib/pgsql/data/postgresql.conf.striker /var/lib/pgsql/data/postgresql.conf
</syntaxhighlight>
<syntaxhighlight lang="diff">
--- /var/lib/pgsql/data/postgresql.conf.striker 2015-01-16 15:33:30.970370628 -0500
+++ /var/lib/pgsql/data/postgresql.conf 2015-01-16 15:34:16.603482692 -0500
@@ -56,6 +56,7 @@
# - Connection Settings -
+listen_addresses = '*'
#listen_addresses = 'localhost' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost', '*' = all
</syntaxhighlight>
<syntaxhighlight lang="bash">
/etc/init.d/postgresql reload
</syntaxhighlight>
<syntaxhighlight lang="text">
</syntaxhighlight>
Create the striker user.
<syntaxhighlight lang="bash">
su - postgres -c "createuser --no-superuser --createdb --no-createrole striker"
</syntaxhighlight>
<syntaxhighlight lang="bash">
# no output expected
</syntaxhighlight>
<syntaxhighlight lang="bash">
</syntaxhighlight>
<syntaxhighlight lang="text">
</syntaxhighlight>
Create DB:
<syntaxhighlight lang="bash">
su - postgres -c "createdb --owner striker scanner"
</syntaxhighlight>
<syntaxhighlight lang="bash">
# no output expected
</syntaxhighlight>
Now download the SQL files we're going to load.
<syntaxhighlight lang="bash">
git clone https://github.com/digimer/striker.git
</syntaxhighlight>
<syntaxhighlight lang="text">
Initialized empty Git repository in /root/striker/.git/
remote: Counting objects: 3602, done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 3602 (delta 25), reused 0 (delta 0)
Receiving objects: 100% (3602/3602), 7.88 MiB | 1024 KiB/s, done.
Resolving deltas: 100% (2307/2307), done.
</syntaxhighlight>
<syntaxhighlight lang="bash">
cd striker
git checkout scanner
</syntaxhighlight>
<syntaxhighlight lang="text">
Branch scanner set up to track remote branch scanner from origin.
Switched to a new branch 'scanner'
</syntaxhighlight>
<syntaxhighlight lang="bash">
cd Scanner/SQL/
ls -lah
</syntaxhighlight>
<syntaxhighlight lang="text">
total 40K
drwxr-xr-x.  2 root root 4.0K Jan 16 15:18 .
drwxr-xr-x. 13 root root 4.0K Jan 16 15:18 ..
-rw-r--r--.  1 root root 3.3K Jan 16 15:18 01_create_node.sql
-rw-r--r--.  1 root root 3.3K Jan 16 15:18 02_create_alerts.sql
-rw-r--r--.  1 root root 2.5K Jan 16 15:18 03_create_alert_listeners.sql
-rw-r--r--.  1 root root 1.2K Jan 16 15:18 04_load_alert_listeners.sql
-rw-r--r--.  1 root root 3.3K Jan 16 15:18 05_create_random_agent.sql
-rw-r--r--.  1 root root 3.4K Jan 16 15:18 06_create_snm_apc_ups.sql
-rw-r--r--.  1 root root 3.3K Jan 16 15:18 07_create_ipmi.sql
-rw-r--r--.  1 root root 3.3K Jan 16 15:18 08_create_raid.sql
</syntaxhighlight>
Load SQL files
These are currently hard-coded to 'alteeve' user, switch to the 'striker' user.
<syntaxhighlight lang="bash">
sed -i 's/alteeve/striker/' *
</syntaxhighlight>
----
<span class="code"></span>
<syntaxhighlight lang="bash">
</syntaxhighlight>
<syntaxhighlight lang="text">
</syntaxhighlight>




{{footer}}
{{footer}}

Revision as of 20:40, 16 January 2015

 AN!Wiki :: How To :: ScanCore

Warning: This is little more that raw notes, do not consider anything here to be valid or accurate at this time.

Installing

Database Setup

yum install -y postgresql postgresql-server postgresql-plperl postgresql-contrib postgresql-libs git
...
Complete!

DB config:

/etc/init.d/postgresql initdb
Initializing database:                                     [  OK  ]

Start

/etc/init.d/postgresql start
Starting postgresql service:                               [  OK  ]

Set 'postgres' user password>


Configure access

cp /var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf.striker
vim /var/lib/pgsql/data/pg_hba.conf
diff -u /var/lib/pgsql/data/pg_hba.conf.striker /var/lib/pgsql/data/pg_hba.conf
--- /var/lib/pgsql/data/pg_hba.conf.striker	2015-01-16 15:24:38.985895621 -0500
+++ /var/lib/pgsql/data/pg_hba.conf	2015-01-16 15:26:42.611236927 -0500
@@ -65,9 +65,13 @@
 
 
 # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
+# dashboards
+host    all         all         10.20.4.0/24          md5
+# node servers
+host    all         all         10.20.70.0/24         md5
 
 # "local" is for Unix domain socket connections only
-local   all         all                               ident
+local   all         all                               md5
 # IPv4 local connections:
 host    all         all         127.0.0.1/32          ident
 # IPv6 local connections:
cp /var/lib/pgsql/data/postgresql.conf /var/lib/pgsql/data/postgresql.conf.striker
vim /var/lib/pgsql/data/postgresql.conf
diff -u /var/lib/pgsql/data/postgresql.conf.striker /var/lib/pgsql/data/postgresql.conf
--- /var/lib/pgsql/data/postgresql.conf.striker	2015-01-16 15:33:30.970370628 -0500
+++ /var/lib/pgsql/data/postgresql.conf	2015-01-16 15:34:16.603482692 -0500
@@ -56,6 +56,7 @@
 
 # - Connection Settings -
 
+listen_addresses = '*'
 #listen_addresses = 'localhost'		# what IP address(es) to listen on;
 					# comma-separated list of addresses;
 					# defaults to 'localhost', '*' = all
/etc/init.d/postgresql reload

Create the striker user.

su - postgres -c "createuser --no-superuser --createdb --no-createrole striker"
# no output expected



Create DB:

su - postgres -c "createdb --owner striker scanner"
# no output expected

Now download the SQL files we're going to load.

git clone https://github.com/digimer/striker.git
Initialized empty Git repository in /root/striker/.git/
remote: Counting objects: 3602, done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 3602 (delta 25), reused 0 (delta 0)
Receiving objects: 100% (3602/3602), 7.88 MiB | 1024 KiB/s, done.
Resolving deltas: 100% (2307/2307), done.
cd striker
git checkout scanner
Branch scanner set up to track remote branch scanner from origin.
Switched to a new branch 'scanner'
cd Scanner/SQL/
ls -lah
total 40K
drwxr-xr-x.  2 root root 4.0K Jan 16 15:18 .
drwxr-xr-x. 13 root root 4.0K Jan 16 15:18 ..
-rw-r--r--.  1 root root 3.3K Jan 16 15:18 01_create_node.sql
-rw-r--r--.  1 root root 3.3K Jan 16 15:18 02_create_alerts.sql
-rw-r--r--.  1 root root 2.5K Jan 16 15:18 03_create_alert_listeners.sql
-rw-r--r--.  1 root root 1.2K Jan 16 15:18 04_load_alert_listeners.sql
-rw-r--r--.  1 root root 3.3K Jan 16 15:18 05_create_random_agent.sql
-rw-r--r--.  1 root root 3.4K Jan 16 15:18 06_create_snm_apc_ups.sql
-rw-r--r--.  1 root root 3.3K Jan 16 15:18 07_create_ipmi.sql
-rw-r--r--.  1 root root 3.3K Jan 16 15:18 08_create_raid.sql

Load SQL files

These are currently hard-coded to 'alteeve' user, switch to the 'striker' user.

sed -i 's/alteeve/striker/' *





 

Any questions, feedback, advice, complaints or meanderings are welcome.
Alteeve's Niche! Enterprise Support:
Alteeve Support
Community Support
© Alteeve's Niche! Inc. 1997-2024   Anvil! "Intelligent Availability®" Platform
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.