2018年8月27日 星期一

CACTI 安裝於Ubuntu 1604

LAMP必須先安裝好

# vi /etc/apt/sources.list

於最後加入
deb http://ftp.ro.debian.org/debian/ stretch main contrib non-free
deb-src http://ftp.ro.debian.org/debian/ stretch main
deb http://security.debian.org/debian-security stretch/updates main contrib non-free
deb-src http://security.debian.org/debian-security stretch/updates main

#apt update
#apt upgrade

#apt install php7.0-snmp php7.0-xml php7.0-mbstring php7.0-json php7.0-gd php7.0-gmp php7.0-zip php7.0-ldap php7.0-mcrypt

# echo "date.timezone = Asia/Taipei" >> /etc/php/7.0/apache2/php.ini
# mysql -u root -p
MariaDB [(none)]> create database cacti;
MariaDB [(none)]> grant all on cacti.* to 'cactiuser'@'localhost' identified by 'password1';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit

# mysql -u root -p mysql < /usr/share/mysql/mysql_test_data_timezone.sql
# mysql -u root -p -e 'grant select on mysql.time_zone_name to cactiuser@localhost'

# vi /etc/mysql/mariadb.conf.d/50-server.cnf   將下列加入底部
max_heap_table_size             = 98M
tmp_table_size                  = 64M
join_buffer_size                = 64M
innodb_buffer_pool_size = 485M
innodb_doublewrite              = off
innodb_flush_log_at_timeout     = 3
innodb_read_io_threads  = 32
innodb_write_io_threads = 16

# systemctl restart mysql apache2
# systemctl status mysql apache2

下載Cacti
# wget https://www.cacti.net/downloads/cacti-latest.tar.gz
# tar xfz cacti-latest.tar.gz
# cp -rf cacti-1.1.38/* /var/www/html

# rm /var/www/html/index.html
# touch /var/www/html/log/cacti.log
# chown -R www-data:www-data /var/www/html/
# vi /var/www/html/include/config.php        變更資料庫Cacti的密碼
$database_type     = 'mysql';
$database_default  = 'cacti';
$database_hostname = 'localhost';
$database_username = 'cactiuser';
$database_password = 'xxxxx';
$database_port     = '3306';
$database_ssl      = false;

#  mysql -u cactiuser cacti -p < /var/www/html/cacti.sql
# apt install snmp snmpd snmp-mibs-downloader rrdtool
# systemctl restart snmpd.service
# systemctl  status  snmpd.service
# ss -tulpn| grep snmp

下載及安裝Cacti-Spine
# apt install build-essential dos2unix dh-autoreconf help2man libssl-dev libmysql++-dev  librrds-perl libsnmp-dev libmysqlclient-dev libmysqld-dev

# wget https://www.cacti.net/downloads/spine/cacti-spine-latest.tar.gz
# tar xfz cacti-spine-latest.tar.gz
# cd cacti-spine-1.1.38
# ./bootstrap
# ./configure
# make
# make install
# chown root:root /usr/local/spine/bin/spine
# chmod +s /usr/local/spine/bin/spine
# vi /usr/local/spine/etc/spine.conf  新增檔案,加入下列

DB_Host localhost
DB_Database cacti
DB_User cactiuser
DB_Pass password1
DB_Port 3306
DB_PreG 0

http://IP/install























安裝完成

LAMP 安裝於Ubuntu 1604

安裝Apache
#  apt install apache2
# systemctl status apache2.service
# netstat -tlpn


打開瀏覽器http://IP 確認Apache 服務正常

如果Web要使用HTTPS,必須啟動Apache SSL
 # a2ensite default-ssl.conf
 # systemctl restart apache2.service
 # netstat -tlpn
















打開瀏覽器https://IP 確認Apache 服務正常

安裝PHP

# apt search php7.0
# apt install php7.0 libapache2-mod-php7.0 php7.0-mysql php7.0-xml php7.0-gd
# php -v
# vi /var/www/html/info.php 新增此檔,內容如下:
<?php
phpinfo();
?>
# systemctl restart apache2
開啟瀏覽器 http://ip/info.php





















如果要額外安裝PHP模組,可以使用下列指令列出可安裝之麼組
# apt install php7.0











安裝MariaDB 10
# apt install php7.0-mysql mariadb-server mariadb-client
# mysql_secure_installation
# mysql
MariaDB [(none)]> use mysql;
MariaDB [mysql]> update user set plugin=’‘ where User=’root’;
MariaDB [mysql]> flush privileges;
MariaDB [mysql]> exit

# systemctl restart mysql.service
# mysql -u root -p





2018年6月27日 星期三

Splunk 安裝於Ubuntu 16.4 LTS

1. 在官方網站下載Splunk
2. 以Root權限安裝Splunk

# dpkg -i splunk-7.1.1-8f0ead9ec3db-linux-2.6-amd64.deb
Selecting previously unselected package splunk.
(Reading database ... 146804 files and directories currently installed.)
Preparing to unpack splunk-7.1.1-8f0ead9ec3db-linux-2.6-amd64.deb ...
Unpacking splunk (7.1.1) ...
Setting up splunk (7.1.1) ...
complete
# dpkg --status splunk
Package: splunk
Status: install ok installed
Maintainer: Splunk Inc. <info@splunk.com>
Architecture: amd64
Version: 7.1.1
Description: Splunk The platform for machine data.
# dpkg --list
Desired=Unknown/Install/Remove/Purge/Hold


ii  splunk              7.1.1          amd64          Splunk The platform for machine data.


# /opt/splunk/bin/splunk  start
:略
Do you agree with this license? [y/n]: y

This appears to be your first time running this version of Splunk.

An Admin password must be set before installation proceeds.
Password must contain at least:
   * 8 total printable ASCII character(s).
Please enter a new password: 輸入密碼
Please confirm new password: 再次輸入密碼
Copying '/opt/splunk/etc/openldap/ldap.conf.default' to '/opt/splunk/etc/openldap/ldap.conf'.
Generating RSA private key, 2048 bit long modulus
..................................................................................................................+++
..................................................+++
e is 65537 (0x10001)
writing RSA key

Generating RSA private key, 2048 bit long modulus
.......+++
..........+++
e is 65537 (0x10001)
writing RSA key

Moving '/opt/splunk/share/splunk/search_mrsparkle/modules.new' to '/opt/splunk/share/splunk/search_mrsparkle/modules'.

Splunk> Be an IT superhero. Go home early.

Checking prerequisites...
        Checking http port [8000]: open
        Checking mgmt port [8089]: open
        Checking appserver port [127.0.0.1:8065]: open
        Checking kvstore port [8191]: open
        Checking configuration...  Done.
                Creating: /opt/splunk/var/lib/splunk
                Creating: /opt/splunk/var/run/splunk
                Creating: /opt/splunk/var/run/splunk/appserver/i18n
                Creating: /opt/splunk/var/run/splunk/appserver/modules/static/css
                Creating: /opt/splunk/var/run/splunk/upload
                Creating: /opt/splunk/var/spool/splunk
                Creating: /opt/splunk/var/spool/dirmoncache
                Creating: /opt/splunk/var/lib/splunk/authDb
                Creating: /opt/splunk/var/lib/splunk/hashDb
New certs have been generated in '/opt/splunk/etc/auth'.
        Checking critical directories...        Done
        Checking indexes...
                Validated: _audit _internal _introspection _telemetry _thefishbucket history main summary
        Done
        Checking filesystem compatibility...  Done
        Checking conf files for problems...
        Done
        Checking default conf files for edits...
        Validating installed files against hashes from '/opt/splunk/splunk-7.1.1-8f0ead9ec3db-linux-2.6-x86_64-manifest'
        All installed files intact.
        Done
All preliminary checks passed.

Starting splunk server daemon (splunkd)...
Generating a 2048 bit RSA private key
...+++
..............................................................................................................................+++
writing new private key to 'privKeySecure.pem'
-----
Signature ok
subject=/CN=elk60/O=SplunkUser
Getting CA Private Key
writing RSA key
Done


Waiting for web server at http://127.0.0.1:8000 to be available.... Done


If you get stuck, we're here to help.
Look for answers here: http://docs.splunk.com

The Splunk web interface is at http://elk60:8000

完成安裝,開啟瀏覽器 ,以admin帳號,及前面輸入的密碼 








2018年5月2日 星期三

Avamar 備份task creation encountered a quiesce problem錯誤訊息

備份出現Completed w/Exception(s)   Error Code 10020





VM backups report Completed w/ Exception
參閱Article Number 000470426

於Avamar Administrator --> Tools --> Manage Datasets
Copy 並改名編輯及新的Datasets  (例如xxx_Quiesced)

選擇Option ->分別選擇  Windows VMware Image  Linux VMware Image


 Enter Attribute 欄位輸入 [avvcbimage]quiesce_fs
在 Under Enter Attribute Value 欄位輸入 false

在備份的Policy的Dataset選擇xxx_Quiesced的Dataset,即完成設定。