PG1X WIKI

My Knowledge Base

User Tools

Site Tools


tech:monitoring:zabbix:install-zabbix-server-3.0-on-artful:install-zabbix-server-3.0-on-artful

Install Zabbix Server 3.0 on Ubuntu 17.10(Artful) [FAIL]

Backed RDBMS is PostgreSQL.

sudo apt -y install zabbix-server-pgsql zabbix-frontend-php
sudo apt -y install php-pgsql
sudo apt -y install zabbix-agent
sudo cp /etc/postgresql/9.6/main/pg_hba.conf{,.orig}
sudo cat <<EOF | sudo tee /etc/postgresql/9.6/main/pg_hba.conf
local all postgres peer
local all all md5
host  all all 127.0.0.1/32 md5
host  all all ::1/128 md5
host  all postgres 0.0.0.0/0 reject
host  all all 0.0.0.0/0 md5
EOF

sudo chmod 644 /etc/postgresql/9.6/main/pg_hba.conf
sudo systemctl restart postgresql
sudo systemctl status postgresql
sudo su - postgres -c 'createdb zabbix'
sudo su - postgres -c 'createuser -P -S -R -D zabbix'
Enter password for new role: zabbix
Enter it again: zabbix
sudo -u postgres -i
/etc/postgresql/9.6/main/postgresql.conf
listen_addresses = 'localhost'
ssl = off
sudo systemctl restart postgresql
postgres@serial:~$ ls -l /usr/share/zabbix-server-pgsql/
total 1152
-rw-r--r-- 1 root root   50353 Jun  4  2017 data.sql.gz
-rw-r--r-- 1 root root 1093144 Jun  4  2017 images.sql.gz
-rw-r--r-- 1 root root   10409 Jun  4  2017 schema.sql.gz
-rw-r--r-- 1 root root      48 Jun  6  2016 zabbix
-rw-r--r-- 1 root root   14845 Jun  4  2017 zabbix_server.conf
You should execute queries following correct order.
zcat /usr/share/zabbix-server-pgsql/schema.sql.gz | PGPASSWORD=zabbix psql -U zabbix zabbix
zcat /usr/share/zabbix-server-pgsql/images.sql.gz | PGPASSWORD=zabbix psql -U zabbix zabbix
zcat /usr/share/zabbix-server-pgsql/data.sql.gz | PGPASSWORD=zabbix psql -U zabbix zabbix
sudo vi /etc/zabbix/zabbix_server.conf
DBHost=
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
sudo cp /usr/share/doc/zabbix-frontend-php/examples/apache.conf /etc/apache2/conf.d/zabbix.conf
root@serial:~# cat /usr/share/doc/zabbix-frontend-php/examples/apache.conf
# Define /zabbix alias, this is the default
<IfModule mod_alias.c>
    Alias /zabbix /usr/share/zabbix
</IfModule>
/etc/apache2/ports.conf
Listen 8081

It's multi-site, therefore don't use /etc/apache2/conf-available/zabbix-frontend-php.conf file that 'zabbix-frontend-php' package default.

/etc/apache2/sites-available/zabbix.conf
<VirtualHost *:8081>
    #ServerName www.example.com
    ServerAdmin webmaster@localhost
    DocumentRoot /usr/share/zabbix
    ErrorLog ${APACHE_LOG_DIR}/zabbix-error.log
    CustomLog ${APACHE_LOG_DIR}/zabbix-access.log combined
    #Include conf-available/serve-cgi-bin.conf
 
    #<IfModule mod_alias.c>
    #    Alias /zabbix /usr/share/zabbix
    #</IfModule>
 
    <Directory "/usr/share/zabbix">
        Options FollowSymLinks
        AllowOverride None
        Require all granted
 
        <IfModule mod_php5.c>
            php_value max_execution_time 300
            php_value memory_limit 128M
            php_value post_max_size 16M
            php_value upload_max_filesize 2M
            php_value max_input_time 300
            php_value always_populate_raw_post_data -1
            php_value date.timezone Asia/Tokyo
        </IfModule>
 
        <IfModule mod_php7.c>
            php_value max_execution_time 300
            php_value memory_limit 128M
            php_value post_max_size 16M
            php_value upload_max_filesize 2M
            php_value max_input_time 300
            php_value date.timezone Asia/Tokyo
        </IfModule>
    </Directory>
 
    <Directory ~ "^/usr/share/zabbix/(conf|app|include|local)/">
        Require all denied
 
        <files *.php>
            Require all denied
        </files>
    </Directory>
 
</VirtualHost>
 
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
$ sudo a2ensite zabbix
Enabling site zabbix.
To activate the new configuration, you need to run:
  systemctl reload apache2
sudo systemctl reload apache2
sudo systemctl restart zabbix-agentd
sudo systemctl status zabbix-agentd
sudo systemctl restart zabbix-server
sudo systemctl status zabbix-server
sudo cat /var/log/zabbix/zabbix_server.log

✘╹◡╹✘  18-06-07 21:10:11 /home/wnoguchi
% sudo -u postgres -i
postgres@serial:~$ psql
psql (9.6.9)
Type "help" for help.

postgres=# \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
 postgres  | postgres | UTF8     | en_US.utf-8 | en_US.utf-8 |
 template0 | postgres | UTF8     | en_US.utf-8 | en_US.utf-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.utf-8 | en_US.utf-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 zabbix    | postgres | UTF8     | en_US.utf-8 | en_US.utf-8 |
(4 rows)

postgres=# \d
No relations found.
postgres=# zabbix
postgres-# \d
No relations found.
postgres-# \d zabbix
Did not find any relation named "zabbix".
postgres-# \c zabbix
You are now connected to database "zabbix" as user "postgres".
zabbix-# \d
                    List of relations
 Schema |            Name            |   Type   | Owner
--------+----------------------------+----------+--------
 public | acknowledges               | table    | zabbix
 public | actions                    | table    | zabbix
 public | alerts                     | table    | zabbix
 public | application_discovery      | table    | zabbix
 public | application_prototype      | table    | zabbix
 public | application_template       | table    | zabbix
 public | applications               | table    | zabbix
 public | auditlog                   | table    | zabbix
 public | auditlog_details           | table    | zabbix
 public | autoreg_host               | table    | zabbix
 public | conditions                 | table    | zabbix
 public | config                     | table    | zabbix
 public | dbversion                  | table    | zabbix
 public | dchecks                    | table    | zabbix
 public | dhosts                     | table    | zabbix
 public | drules                     | table    | zabbix
 public | dservices                  | table    | zabbix
 public | escalations                | table    | zabbix
 public | events                     | table    | zabbix
 public | expressions                | table    | zabbix
 public | functions                  | table    | zabbix
 public | globalmacro                | table    | zabbix
 public | globalvars                 | table    | zabbix
 public | graph_discovery            | table    | zabbix
 public | graph_theme                | table    | zabbix
 public | graphs                     | table    | zabbix
 public | graphs_items               | table    | zabbix
 public | group_discovery            | table    | zabbix
 public | group_prototype            | table    | zabbix
 public | groups                     | table    | zabbix
 public | history                    | table    | zabbix
 public | history_log                | table    | zabbix
 public | history_str                | table    | zabbix
 public | history_text               | table    | zabbix
 public | history_uint               | table    | zabbix
 public | host_discovery             | table    | zabbix
 public | host_inventory             | table    | zabbix
 public | hostmacro                  | table    | zabbix
 public | hosts                      | table    | zabbix
 public | hosts_groups               | table    | zabbix
 public | hosts_templates            | table    | zabbix
 public | housekeeper                | table    | zabbix
 public | httpstep                   | table    | zabbix
 public | httpstepitem               | table    | zabbix
 public | httptest                   | table    | zabbix
 public | httptestitem               | table    | zabbix
 public | icon_map                   | table    | zabbix
 public | icon_mapping               | table    | zabbix
 public | ids                        | table    | zabbix
 public | images                     | table    | zabbix
 public | interface                  | table    | zabbix
 public | interface_discovery        | table    | zabbix
 public | item_application_prototype | table    | zabbix
 public | item_condition             | table    | zabbix
 public | item_discovery             | table    | zabbix
 public | items                      | table    | zabbix
 public | items_applications         | table    | zabbix
 public | maintenances               | table    | zabbix
 public | maintenances_groups        | table    | zabbix
 public | maintenances_hosts         | table    | zabbix
 public | maintenances_windows       | table    | zabbix
 public | mappings                   | table    | zabbix
 public | media                      | table    | zabbix
 public | media_type                 | table    | zabbix
 public | opcommand                  | table    | zabbix
 public | opcommand_grp              | table    | zabbix
 public | opcommand_hst              | table    | zabbix
 public | opconditions               | table    | zabbix
 public | operations                 | table    | zabbix
 public | opgroup                    | table    | zabbix
 public | opinventory                | table    | zabbix
 public | opmessage                  | table    | zabbix
 public | opmessage_grp              | table    | zabbix
 public | opmessage_usr              | table    | zabbix
 public | optemplate                 | table    | zabbix
 public | profiles                   | table    | zabbix
 public | proxy_autoreg_host         | table    | zabbix
 public | proxy_autoreg_host_id_seq  | sequence | zabbix
 public | proxy_dhistory             | table    | zabbix
 public | proxy_dhistory_id_seq      | sequence | zabbix
 public | proxy_history              | table    | zabbix
 public | proxy_history_id_seq       | sequence | zabbix
 public | regexps                    | table    | zabbix
 public | rights                     | table    | zabbix
 public | screen_user                | table    | zabbix
 public | screen_usrgrp              | table    | zabbix
 public | screens                    | table    | zabbix
 public | screens_items              | table    | zabbix
 public | scripts                    | table    | zabbix
 public | service_alarms             | table    | zabbix
 public | services                   | table    | zabbix
 public | services_links             | table    | zabbix
 public | services_times             | table    | zabbix
 public | sessions                   | table    | zabbix
 public | slides                     | table    | zabbix
 public | slideshow_user             | table    | zabbix
 public | slideshow_usrgrp           | table    | zabbix
 public | slideshows                 | table    | zabbix
 public | sysmap_element_url         | table    | zabbix
 public | sysmap_url                 | table    | zabbix
 public | sysmap_user                | table    | zabbix
 public | sysmap_usrgrp              | table    | zabbix
 public | sysmaps                    | table    | zabbix
 public | sysmaps_elements           | table    | zabbix
 public | sysmaps_link_triggers      | table    | zabbix
 public | sysmaps_links              | table    | zabbix
 public | timeperiods                | table    | zabbix
 public | trends                     | table    | zabbix
 public | trends_uint                | table    | zabbix
 public | trigger_depends            | table    | zabbix
 public | trigger_discovery          | table    | zabbix
 public | triggers                   | table    | zabbix
 public | users                      | table    | zabbix
 public | users_groups               | table    | zabbix
 public | usrgrp                     | table    | zabbix
 public | valuemaps                  | table    | zabbix
(116 rows)

zabbix-#
✘╹◡╹✘  18-06-07 21:23:27 /home/wnoguchi
% psql -h localhost -U zabbix -W zabbix
Password for user zabbix:
psql (9.6.9)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.

zabbix=> \q

Could not connect to PostgreSQL…

✘╹◡╹✘  18-06-08 7:56:07 /home/wnoguchi
% sudo tcpdump -i lo
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 262144 bytes
07:56:27.767448 IP localhost.41782 > localhost.postgresql: Flags [S], seq 1287044486, win 43690, options [mss 65495,sackOK,TS val 19666323 ecr 0,nop,wscale 7], length 0
07:56:27.767482 IP localhost.postgresql > localhost.41782: Flags [S.], seq 756577283, ack 1287044487, win 43690, options [mss 65495,sackOK,TS val 19666323 ecr 19666323,nop,wscale 7], length 0
07:56:27.767516 IP localhost.41782 > localhost.postgresql: Flags [.], ack 1, win 342, options [nop,nop,TS val 19666323 ecr 19666323], length 0
07:56:27.767586 IP localhost.41782 > localhost.postgresql: Flags [P.], seq 1:9, ack 1, win 342, options [nop,nop,TS val 19666323 ecr 19666323], length 8
07:56:27.796835 IP localhost.41782 > localhost.postgresql: Flags [P.], seq 363:368, ack 595, win 350, options [nop,nop,TS val 19666352 ecr 19666342], length 5
07:56:27.796890 IP localhost.41782 > localhost.postgresql: Flags [F.], seq 368, ack 595, win 350, options [nop,nop,TS val 19666352 ecr 19666342], length 0
07:56:27.796985 IP localhost.34612 > localhost.34612: UDP, length 936
07:56:27.797082 IP localhost.34612 > localhost.34612: UDP, length 936
07:56:27.797152 IP localhost.34612 > localhost.34612: UDP, length 936
07:56:27.797229 IP localhost.34612 > localhost.34612: UDP, length 936
07:56:27.797514 IP localhost.34612 > localhost.34612: UDP, length 936
07:56:27.797585 IP localhost.34612 > localhost.34612: UDP, length 824
07:56:27.797682 IP localhost.34612 > localhost.34612: UDP, length 488
07:56:27.801185 IP localhost.postgresql > localhost.41782: Flags [F.], seq 595, ack 369, win 342, options [nop,nop,TS val 19666357 ecr 19666352], length 0
07:56:27.801226 IP localhost.41782 > localhost.postgresql: Flags [.], ack 596, win 350, options [nop,nop,TS val 19666357 ecr 19666357], length 0
07:56:32.898071 IP localhost.42550 > localhost.zabbix-trapper: Flags [S], seq 2063312613, win 43690, options [mss 65495,sackOK,TS val 19671453 ecr 0,nop,wscale 7], length 0
07:56:32.898107 IP localhost.zabbix-trapper > localhost.42550: Flags [R.], seq 0, ack 2063312614, win 0, length 0
^C
17 packets captured
74 packets received by filter
40 packets dropped by kernel
✘╹◡╹✘  18-06-08 7:58:57 /home/wnoguchi
% sudo tcpdump -nAi lo port 5432
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 262144 bytes
07:59:04.911804 IP 127.0.0.1.41794 > 127.0.0.1.5432: Flags [S], seq 2997530111, win 43690, options [mss 65495,sackOK,TS val 19823467 ecr 0,nop,wscale 7], length 0
E..<1.@.@............B.8.............0.........
..{k........
07:59:04.911849 IP 127.0.0.1.5432 > 127.0.0.1.41794: Flags [S.], seq 1295549341, ack 2997530112, win 43690, options [mss 65495,sackOK,TS val 19823468 ecr 19823467,nop,wscale 7], length 0
E..<..@.@.<..........8.BM8...........0.........
..{l..{k....
07:59:04.911891 IP 127.0.0.1.41794 > 127.0.0.1.5432: Flags [.], ack 1, win 342, options [nop,nop,TS val 19823468 ecr 19823468], length 0
E..41.@.@............B.8....M8.....V.(.....
..{l..{l
07:59:04.911986 IP 127.0.0.1.41794 > 127.0.0.1.5432: Flags [P.], seq 1:9, ack 1, win 342, options [nop,nop,TS val 19823468 ecr 19823468], length 8
E..<1.@.@............B.8....M8.....V.0.....
..{l..{l......./
07:59:04.913966 IP 127.0.0.1.5432 > 127.0.0.1.41794: Flags [P.], seq 1:2, ack 9, win 342, options [nop,nop,TS val 19823470 ecr 19823468], length 1
E..5.t@.@..M.........8.BM8.........V.).....
..{n..{lN
07:59:04.913997 IP 127.0.0.1.41794 > 127.0.0.1.5432: Flags [.], ack 2, win 342, options [nop,nop,TS val 19823470 ecr 19823470], length 0
E..41.@.@............B.8....M8.....V.(.....
..{n..{n
07:59:04.914122 IP 127.0.0.1.41794 > 127.0.0.1.5432: Flags [P.], seq 9:46, ack 2, win 342, options [nop,nop,TS val 19823470 ecr 19823470], length 37
E..Y1.@.@............B.8....M8.....V.M.....
..{n..{n...%....user.zabbix.database.zabbix..
07:59:04.915465 IP 127.0.0.1.5432 > 127.0.0.1.41794: Flags [P.], seq 2:15, ack 46, win 342, options [nop,nop,TS val 19823471 ecr 19823470], length 13
E..A.u@.@..@.........8.BM8.....-...V.5.....
..{o..{nR............
07:59:04.915562 IP 127.0.0.1.41794 > 127.0.0.1.5432: Flags [P.], seq 46:87, ack 15, win 342, options [nop,nop,TS val 19823471 ecr 19823471], length 41
E..]1.@.@............B.8...-M8.....V.Q.....
..{o..{op...(md5725aa54089c33d9355378a2cfb833f15.
07:59:04.918072 IP 127.0.0.1.5432 > 127.0.0.1.41794: Flags [P.], seq 15:334, ack 87, win 342, options [nop,nop,TS val 19823474 ecr 19823471], length 319
E..s.v@.@............8.BM8.....V...V.g.....
..{r..{oR........S....application_name..S....client_encoding.UTF8.S....DateStyle.ISO, MDY.S....integer_datetimes.on.S....IntervalStyle.postgres.S....is_superuser.off.S....server_encoding.UTF8.S....server_version.9.6.9.S...!session_authorization.zabbix.S...#standard_conforming_strings.on.S....TimeZone.Japan.K........T../Z....I
07:59:04.918250 IP 127.0.0.1.41794 > 127.0.0.1.5432: Flags [P.], seq 87:119, ack 334, win 350, options [nop,nop,TS val 19823474 ecr 19823474], length 32
E..T1.@.@............B.8...VM8.....^.H.....
..{r..{rQ....SET search_path = 'public'.
07:59:04.918462 IP 127.0.0.1.5432 > 127.0.0.1.41794: Flags [P.], seq 334:349, ack 119, win 342, options [nop,nop,TS val 19823474 ecr 19823474], length 15
E..C.w@.@..<.........8.BM8.....v...V.7.....
..{r..{rC....SET.Z....I
07:59:04.918582 IP 127.0.0.1.41794 > 127.0.0.1.5432: Flags [P.], seq 119:150, ack 349, win 350, options [nop,nop,TS val 19823474 ecr 19823474], length 31
E..S1.@.@............B.8...vM8.....^.G.....
..{r..{rQ....SET bytea_output = escape.
07:59:04.918684 IP 127.0.0.1.5432 > 127.0.0.1.41794: Flags [P.], seq 349:364, ack 150, win 342, options [nop,nop,TS val 19823474 ecr 19823474], length 15
E..C.x@.@..;.........8.BM8.........V.7.....
..{r..{rC....SET.Z....I
07:59:04.919025 IP 127.0.0.1.41794 > 127.0.0.1.5432: Flags [P.], seq 150:277, ack 364, win 350, options [nop,nop,TS val 19823475 ecr 19823474], length 127
E...1.@.@..).........B.8....M8. ...^.......
..{s..{rQ...~SELECT 1 FROM information_schema.tables WHERE table_catalog='zabbix' AND table_schema='public' AND table_name='dbversion'.
07:59:04.929297 IP 127.0.0.1.5432 > 127.0.0.1.41794: Flags [P.], seq 364:430, ack 277, win 342, options [nop,nop,TS val 19823485 ecr 19823475], length 66
E..v.y@.@............8.BM8.     .......V.j.....
..{}..{sT...!..?column?...................D..........1C....SELECT 1.Z....I
07:59:04.929593 IP 127.0.0.1.41794 > 127.0.0.1.5432: Flags [P.], seq 277:332, ack 430, win 350, options [nop,nop,TS val 19823485 ecr 19823485], length 55
E..k1.@.@..p.........B.8....M8.K...^._.....
..{}..{}Q...6SELECT dv.mandatory,dv.optional FROM dbversion dv.
07:59:04.930267 IP 127.0.0.1.5432 > 127.0.0.1.41794: Flags [P.], seq 430:541, ack 332, win 342, options [nop,nop,TS val 19823486 ecr 19823485], length 111
E....z@.@............8.BM8.K...K...V.......
..{~..{}T...=..mandatory...E...............optional...E...............D..........3000000....3000000C....SELECT 1.Z....I
07:59:04.930364 IP 127.0.0.1.41794 > 127.0.0.1.5432: Flags [P.], seq 332:363, ack 541, win 350, options [nop,nop,TS val 19823486 ecr 19823486], length 31
E..S1.@.@............B.8...KM8.....^.G.....
..{~..{~Q....SELECT NULL FROM config c.
07:59:04.932214 IP 127.0.0.1.5432 > 127.0.0.1.41794: Flags [P.], seq 541:595, ack 363, win 342, options [nop,nop,TS val 19823488 ecr 19823486], length 54
E..j.{@.@............8.BM8.....j...V.^.....
..{...{~T...!..?column?...................C....SELECT 0.Z....I
07:59:04.942443 IP 127.0.0.1.41794 > 127.0.0.1.5432: Flags [P.], seq 363:368, ack 595, win 350, options [nop,nop,TS val 19823498 ecr 19823488], length 5
E..91.@.@............B.8...jM8.....^.-.....
..{...{.X....
07:59:04.942507 IP 127.0.0.1.41794 > 127.0.0.1.5432: Flags [F.], seq 368, ack 595, win 350, options [nop,nop,TS val 19823498 ecr 19823488], length 0
E..41.@.@............B.8...oM8.....^.(.....
..{...{.
07:59:04.945848 IP 127.0.0.1.5432 > 127.0.0.1.41794: Flags [F.], seq 595, ack 369, win 342, options [nop,nop,TS val 19823501 ecr 19823498], length 0
E..4.|@.@..F.........8.BM8.....p...V.(.....
..{...{.
07:59:04.945878 IP 127.0.0.1.41794 > 127.0.0.1.5432: Flags [.], ack 596, win 350, options [nop,nop,TS val 19823502 ecr 19823501], length 0
E..41.@.@............B.8...pM8.....^.(.....
..{...{.
Unable to select configuration

Zabbix server problem - unable to select configuration · Issue #168 · zabbix/zabbix-docker

try to drop db and execute compose file again, then attach full logs from zabbix server image.
✘╹◡╹✘  18-06-08 8:00:43 /home/wnoguchi
% sudo -u postgres psql
psql (9.6.9)
Type "help" for help.

postgres=# drop database zabbix;
DROP DATABASE
postgres=# \q
✘╹◡╹✘  18-06-08 8:01:06 /home/wnoguchi
% sudo su - postgres -c 'createdb zabbix'
The frontend does not match Zabbix database.

【CentOS】The frontend does not match Zabbix database. - pospomeのプログラミング日記

✘╹◡╹✘  18-06-08 8:02:33 /home/wnoguchi
% zcat /usr/share/zabbix-server-pgsql/schema.sql.gz | PGPASSWORD=zabbix psql -U zabbix zabbix
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE TABLE
CREATE INDEX
(snip)
Unable to select configuration.
zcat /usr/share/zabbix-server-pgsql/images.sql.gz | PGPASSWORD=zabbix psql -U zabbix zabbix
zcat /usr/share/zabbix-server-pgsql/data.sql.gz | PGPASSWORD=zabbix psql -U zabbix zabbix

OK

there is only one zabbix server.

Cannot create the configuration file.
Unable to create the configuration file.

✘╹◡╹✘  18-06-08 8:08:20 /home/wnoguchi
% sudo ls -l /etc/zabbix/zabbix.conf.php
ls: cannot access '/etc/zabbix/zabbix.conf.php': No such file or directory
✘╹◡╹✘  18-06-08 8:24:54 /home/wnoguchi
% sudo -u www-data ls /etc/zabbix/
alert.d  zabbix_agentd.conf  zabbix_agentd.conf.d  zabbix_server.conf  zabbix_server.conf.d
✘╹◡╹✘  18-06-08 8:25:45 /home/wnoguchi
% sudo -u www-data touch /etc/zabbix/
✘╹◡╹✘  18-06-08 8:26:33 /home/wnoguchi
% sudo -u www-data ls -l /etc/zabbix/
total 40
drwxr-xr-x 2 root root  4096 Jun  4  2017 alert.d
-rw-r--r-- 1 root root 10295 Jun  4  2017 zabbix_agentd.conf
drwxr-xr-x 2 root root  4096 Jun  4  2017 zabbix_agentd.conf.d
-rw-r--r-- 1 root root 14871 Jun  6 09:19 zabbix_server.conf
drwxr-xr-x 2 root root  4096 Jun  4  2017 zabbix_server.conf.d
✘╹◡╹✘  18-06-08 8:26:42 /home/wnoguchi
% sudo -u www-data ls -ld /etc/zabbix/
drwxr-xr-x 5 root root 4096 Jun  6 20:43 /etc/zabbix/
✘╹◡╹✘  18-06-08 8:26:58 /home/wnoguchi
% sudo -u www-data touch /etc/zabbix/zabbix.conf.php
touch: cannot touch '/etc/zabbix/zabbix.conf.php': Permission denied
✘╹◡╹✘  18-06-08 8:27:26 /home/wnoguchi
% sudo touch /etc/zabbix/zabbix.conf.php
✘╹◡╹✘  18-06-08 8:27:34 /home/wnoguchi
% sudo chown www-data: /etc/zabbix/zabbix.conf.php
✘╹◡╹✘  18-06-08 8:28:30 /home/wnoguchi
% sudo chmod 600 /etc/zabbix/zabbix.conf.php

Back and Next Step

/etc/zabbix/zabbix.conf.php
<?php
// Zabbix GUI configuration file.
global $DB;
 
$DB['TYPE']     = 'POSTGRESQL';
$DB['SERVER']   = 'localhost';
$DB['PORT']     = '0';
$DB['DATABASE'] = 'zabbix';
$DB['USER']     = 'zabbix';
$DB['PASSWORD'] = 'zabbix';
 
// Schema name. Used for IBM DB2 and PostgreSQL.
$DB['SCHEMA'] = 'public';
 
$ZBX_SERVER      = 'localhost';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = 'Zabbix Server';
 
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;

Default Authentication Information is

  • ID: Admin
  • PASS: zabbix

✘╹◡╹✘  18-06-08 8:30:35 /home/wnoguchi
% sudo systemctl restart zabbix-server
✘╹◡╹✘  18-06-08 8:35:20 /home/wnoguchi
% sudo systemctl status zabbix-server
● zabbix-server.service - Zabbix Server (PostgreSQL)
   Loaded: loaded (/lib/systemd/system/zabbix-server.service; disabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-06-08 08:35:20 JST; 7s ago
     Docs: man:zabbix_server
 Main PID: 644 (zabbix_server)
    Tasks: 27 (limit: 4915)
   CGroup: /system.slice/zabbix-server.service
           ├─644 /usr/sbin/zabbix_server --foreground
           ├─653 /usr/sbin/zabbix_server: configuration syncer [waiting 60 sec for processes]
           ├─654 /usr/sbin/zabbix_server: db watchdog [synced alerts config in 0.015290 sec, idle 60 sec]
           ├─655 /usr/sbin/zabbix_server: poller #1 [got 0 values in 0.000010 sec, idle 5 sec]
           ├─657 /usr/sbin/zabbix_server: poller #2 [got 0 values in 0.000011 sec, idle 5 sec]
           ├─658 /usr/sbin/zabbix_server: poller #3 [got 0 values in 0.000008 sec, idle 5 sec]
           ├─659 /usr/sbin/zabbix_server: poller #4 [got 0 values in 0.000040 sec, idle 5 sec]
           ├─660 /usr/sbin/zabbix_server: poller #5 [got 0 values in 0.000009 sec, idle 5 sec]
           ├─661 /usr/sbin/zabbix_server: unreachable poller #1 [got 0 values in 0.000011 sec, idle 5 sec]
           ├─662 /usr/sbin/zabbix_server: trapper #1 [processed data in 0.000000 sec, waiting for connection]
           ├─663 /usr/sbin/zabbix_server: trapper #2 [processed data in 0.000000 sec, waiting for connection]
           ├─665 /usr/sbin/zabbix_server: trapper #3 [processed data in 0.000026 sec, waiting for connection]
           ├─666 /usr/sbin/zabbix_server: trapper #4 [processed data in 0.000000 sec, waiting for connection]
           ├─667 /usr/sbin/zabbix_server: trapper #5 [processed data in 0.000000 sec, waiting for connection]
           ├─668 /usr/sbin/zabbix_server: icmp pinger #1 [got 0 values in 0.000009 sec, idle 5 sec]
           ├─671 /usr/sbin/zabbix_server: alerter [sent alerts: 0 success, 0 fail in 0.005839 sec, idle 30 sec]
           ├─672 /usr/sbin/zabbix_server: housekeeper [startup idle for 30 minutes]
           ├─676 /usr/sbin/zabbix_server: timer #1 [processed 0 triggers, 0 events in 0.000000 sec, 0 maintenances in 0.000000 sec, idle 10 sec]
           ├─680 /usr/sbin/zabbix_server: http poller #1 [got 0 values in 0.002165 sec, idle 5 sec]
           ├─681 /usr/sbin/zabbix_server: discoverer #1 [processed 0 rules in 0.006558 sec, idle 60 sec]
           ├─682 /usr/sbin/zabbix_server: history syncer #1 [synced 0 items in 0.000002 sec, idle 1 sec]
           ├─683 /usr/sbin/zabbix_server: history syncer #2 [synced 0 items in 0.000002 sec, idle 1 sec]
           ├─686 /usr/sbin/zabbix_server: history syncer #3 [synced 0 items in 0.000001 sec, idle 1 sec]
           ├─687 /usr/sbin/zabbix_server: history syncer #4 [synced 0 items in 0.000002 sec, idle 1 sec]
           ├─688 /usr/sbin/zabbix_server: escalator #1 [processed 0 escalations in 0.001703 sec, idle 3 sec]
           ├─689 /usr/sbin/zabbix_server: proxy poller #1 [exchanged data with 0 proxies in 0.000007 sec, idle 5 sec]
           └─690 /usr/sbin/zabbix_server: self-monitoring [processed data in 0.000042 sec, idle 1 sec]

Jun 08 08:35:20 serial systemd[1]: Started Zabbix Server (PostgreSQL).
Jun 08 08:35:20 serial zabbix_server[644]: Starting Zabbix Server. Zabbix 3.0.7 (revision 64609).
Jun 08 08:35:20 serial zabbix_server[644]: Press Ctrl+C to exit.
✘╹◡╹✘  18-06-08 8:35:27 /home/wnoguchi
% sudo systemctl enable zabbix-server
Synchronizing state of zabbix-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable zabbix-server

still get error…

PHP7 is not acceptable…???

2 Requirements [Zabbix Documentation 3.0]

PHP v7 is not supported yet.

OMG….

References

tech/monitoring/zabbix/install-zabbix-server-3.0-on-artful/install-zabbix-server-3.0-on-artful.txt · Last modified: 2018/06/08 08:48 by wnoguchi