
Добавляем Input(syslog с удаленной машины) в Graylog2
Nov 19 2017, 01:52:10

Итак, добавим изначально логирование из Syslog.
В интерфейсе Graylog2 идем в меню System->Inputs
apt-get install samba
# mkdir newfolder
# mount --bind /folder/to/access/ newfolder
watch -n 2 gearadmin --status
watch -n 3 tail -10 /var/log/php-cli.log
dbpass="pass"
DATE_DIR=$(date +%Y-%m-%d-%H)
mkdir /home/nelex/MySQL_BKP/${DATE_DIR}
for dbname in `echo show databases| mysql -u root -p$dbpass`; do
echo "Dump $dbname..."
mysqldump -u root -p$dbpass $dbname > "~/MySQL_BKP/${DATE_DIR}/$dbname.sql"
mkdir ~/MySQL_BKP
chmod +x mysqlbackup.sh
#!/bin/bash
indir=$1
dblogin="root"
dbpass="pass"
postfix=".sql"
prefix="./"
cd $indir
for file in `find ./ -type f -name "*$postfix"`
do
table_tmp=${file%$postfix}
table_tmp=${table_tmp#$prefix}
table=${table_tmp,,}
mysql -u$dblogin -p$dbpass -e "create database $table default charset utf8"
mysql -u$dblogin -p$dbpass $table < $file
chmod +x mysqlbackup.sh
import_from_dir.sh ~/MySQL_BKP/2015-06-02-14
dpkg: unrecoverable fatal error, aborting:
files list file for package 'imagemagick-6.q16' is missing final newline
# mkdir /var/lib/dpkg/info/old
#mv /var/lib/dpkg/info/imagemagick-6.q16.* \ /var/lib/dpkg/info/old/
bash: /usr/bin/apt-get: cannot execute binary file: Exec format error
dpkg -i apt.deb
Unpacking libapt-pkg-dev:amd64 (1.0.9.10) over (1.0.9.7) ...
dpkg: dependency problems prevent configuration of libapt-pkg-dev:amd64:
libapt-pkg-dev:amd64 depends on libapt-pkg4.12 (= 1.0.9.10); however:
Version of libapt-pkg4.12:amd64 on system is 1.0.9.7.
libapt-pkg-dev:amd64 depends on libapt-inst1.5 (= 1.0.9.10); however:
Version of libapt-inst1.5:amd64 on system is 1.0.9.7.
dpkg: error processing package libapt-pkg-dev:amd64 (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
libapt-pkg-dev:amd64
chmod 755 $(find /path/to/base/dir -type d)
chmod 644 $(find /path/to/base/dir -type f)
# mysql -pmypass mydm < mydb.sql
ERROR 1064 (42000) at line 3597: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '*/' at line 1
/*!50003 */
#vim mydb.sql
:3597
:wq
mysql -pmypass mydm < mydb.sql
dpkg: error processing procps (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
procps
E: Sub-process /usr/bin/dpkg returned an error code (1)
# lsb_release -rd
Description: Debian GNU/Linux 8.0 (jessie)
Release: 8.0
cp /etc/sysctl.conf /etc/sysctl.conf_bkp
#chromium&
#chromium >/tmp/chomium.log&
Fontconfig error: Cannot load default config file
modprobe -r brcmsmac
modprobe brcmsmac
-a No such device
wlan0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.1.105 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: xxxx:xxxx:xxxx:xxxx:xxxx/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:134 errors:0 dropped:0 overruns:0 frame:0
TX packets:167 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:50
RX bytes:26716 (26.0 KiB) TX bytes:39745 (38.8 KiB)