Nethence Newdoc Olddoc Lab Your IP BBDock  

Setting up GNU/Screen

Setup system-wide,

cp -pi /etc/screenrc /etc/screenrc.dist
vi /etc/screenrc

defutf8 on
utf8 on on
startup_message off
caption always "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
shelltitle ""

#fr keyboard alt+, alt+;
bindkey ^[, prev
bindkey ^[; next

Note. other key bindings,

#console F9, F12
bindkey ^[[20~ prev
bindkey ^[[24~ next

Note. other values allowed for caption,

caption always "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%< %{=b BW} %H %{-} %l %c %Y-%m-%d"
%D %M %d %c

Setup wheeled specific log views

user=WHEELED
su - $user
vi .screenrc

note. need to use sh -c for wildcards

for CentOS,

screen -t "log" 0 tail -n 100 -F /var/log/messages
screen -t "mail" 1 tail -n 100 -F /var/log/maillog
screen -t "selinux" 2 tail -n 100 -F /var/log/audit/audit.log
#screen -t "access" 2 sh -c "tail -n 100 -F /var/log/httpd/*access*log"
#screen -t "error" 3 sh -c "tail -n 100 -F /var/log/httpd/*error*log"

for Debian,

screen -t "log" 0 tail -n 100 -F /var/log/messages
screen -t "exim" 1 tail -n 100 -F /var/log/exim4/mainlog
#screen -t "access" 2 sh -c "tail -n 100 -F /var/log/apache2/*access*log"
#screen -t "error" 3 sh -c "tail -n 100 -F /var/log/apache2/*error*log"

for Ubuntu,

screen -t "log" 0 tail -n 100 -F /var/log/syslog
screen -t "mail" 1 tail -n 100 -F /var/log/mail.log
#screen -t "access" 2 sh -c "tail -n 100 -F /var/log/apache2/*access*log"
#screen -t "error" 3 sh -c "tail -n 100 -F /var/log/apache2/*error*log"

and eventually add other shit,

#screen -t "access" 2 sh -c "tail -n 100 -F /usr/local/nginx/logs/*access*log"
#screen -t "error" 3 sh -c "tail -n 100 -F /usr/local/nginx/logs/*error*log"
#screen -t "postfixprod" 4 docker exec -ti postfixprod tail -F /var/log/mail.err /var/log/mail.log
#screen -t "mongo" 1 tail -n 100 -F /var/log/mongodb/mongod.log

Home | GitHub | Donate