Bodovane ulohy:
(ve dvojcich ;; syslog)
client B01:
local1 >= crit -> soubor1
local2 -> soubor2
local1 >= info -> na lokalni server B02
local2 >= info -> na lokalni server B02
lokalni server B02:
local1 >= err -> soubor1
local2 >= warn -> soubor2
local1 -> logsrv
local2 == crit -> logsrv
(+ tester)
[ADU] cvičení 11
- Destroyer
- VCKLAN TEAM
- Příspěvky: 812
- Registrován: čtv 13. srp 2009 13:50:15
- Bydliště: Praha 12
- Kontaktovat uživatele:
Re: cvičení 11 (příprava)
B02 -- lokalni server
Kód: Vybrat vše
#!/bin/bash
for (( i = 1; i <= 2; i++ ))
do
for j in debug info notice warning err crit alert emerg
do
logger -p local${i}.${j} "10.3.45.135 Vlach Miroslav local${i}.${j}"
done
done
Kód: Vybrat vše
# Log all the mail messages in one place.
mail.* -/var/log/maillog
# Log cron stuff
cron.* /var/log/cron
# Everybody gets emergency messages
*.emerg *
# Save news errors of level crit and higher in a special file.
uucp,news.crit /var/log/spooler
# Save boot messages also to boot.log
local7.* /var/log/boot.log
local1.err /var/log/soubor1
local2.warn /var/log/soubor2
local1.* @logsrv
local2.crit;local2.!alert @logsrv
#local1.* /var/log/test1
#local2.crit;local2.!alert /var/log/test2
Kód: Vybrat vše
# Options to syslogd
# -m 0 disables 'MARK' messages.
# -r enables logging from remote machines
# -x disables DNS lookups on messages recieved with -r
# See syslogd(8) for more details
SYSLOGD_OPTIONS="-m 0 -r -h"
Kód: Vybrat vše
ping logsrv
cat /usr/include/syslog.h
cd /etc/sysconfig/
ll
cd ~/Desktop
ll
chmod +x skript.bash
ifconfig
ps -ef | grep sysl
man logger
man sysklogd
cd /etc/sysconfig/
ll
vim syslog
service syslog restart
vim /etc/syslog.conf
service syslog restart
cat /var/log/soubor1
vim /etc/syslog.conf
service syslog restart
cd ~/Desktop
bash skript.bash
cat /var/log/test*
vim /etc/syslog.conf
service syslog restart
bash skript.bash
You're pro or you're a noob. That's life
- Maple
- VCKLAN TEAM
- Příspěvky: 676
- Registrován: úte 01. zář 2009 7:40:17
- Bydliště: Babákova 2152, Praha 4
- Kontaktovat uživatele:
Re: cvičení 11 (příprava)
B01 -- klient
Kód: Vybrat vše
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.* /dev/console
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none /var/log/messages
# The authpriv file has restricted access.
authpriv.* /var/log/secure
# Log all the mail messages in one place.
mail.* -/var/log/maillog
# Log cron stuff
cron.* /var/log/cron
# Everybody gets emergency messages
*.emerg *
# Save news errors of level crit and higher in a special file.
uucp,news.crit /var/log/spooler
# Save boot messages also to boot.log
local7.* /var/log/boot.log
# client B01
local1.crit /var/log/log1
local2.* /var/log/log2
local1.info @10.3.45.135
local2.info @10.3.45.135
Kód: Vybrat vše
service syslog restart #aplikovani konfigurace
Kód: Vybrat vše
#!/bin/bash
for (( i = 1; i <= 2; i++ ))
do
for j in debug info notice warning err crit alert emerg
do
logger -p local${i}.${j} "10.3.45.130 Javurek Jakub local${i}.${j}"
done
done