Linux

20 Linux System Monitoring Tools Every SysAdmin Should Know

[] Need to monitor Linux server performance? Try these built-in commands and a few add-on tools. Most Linux distributions are equipped with tons of monitoring. These tools provide metrics which can be used to get information about system activities. You can use these tools to find the possible causes of a performance problem. The commands discussed below are some of the most basic commands when it comes to system analysis and debugging server issues such as: Finding out bottlenecks. Disk (storage) bottlenecks. CPU and memory bottlenecks. Network bottlenecks. #1: top - Process Activity Command The top program provides a dynamic real-time view of a running system i.e. actual process activity. By default, it displays the most CPU-intensive tasks running on the server and updates the list every five seconds. [] Commonly Used Hot Keys The top command provides several useful hot keys: Hot Key Usage ​ t Displays summary information off and on. ​ m Displays memory information off and on. ​ A Sorts the display by top consumers of various system resources. Useful for quick identification of performance-hungry tasks on a system. ​ f Enters an interactive configuration screen for top. Helpful for setting up top for a specific task.

Continue reading

30 du/df Linux-CMD Beispiele

In this post, we will be discuss the command “du” or disk usage. The du command is a handy command to check folder/file sizes in Linux. This command comes with lots of options which when combining them together can give you a very powerful way to check file/folder size usage of your disk. Syntax for Linux du command du [OPTION]… [FILE]… Basic du command usage Beispiels Beispiel 0x001: Execute du command with no options. As you can see in this Beispiel, using du without any option will list folders recursively by default the size of each file under the directory you chose. The file size here is shown in KB by default. It will show the hidden files and the size of the parent directory as an entry, and the child directories as separate entries. However it will go up to the last directory [root@lxu mnt /]# du /opt 5 /opt/rh 7 /opt Beispiel 0x002: If you dont want to see output in KB’s, use the -h option for a human readable output. Adding the -h option will give you the output in a more readable file size format, with base 1024, it will show the 1024 KB file as 1M which is more easier to read.

Continue reading

9 Lethal Linux Commands You Should Never Run

Linux can be a double-edged sword. It assumes that you know what you’re doing and gives you the freedom to do whatever you want. It won’t question you. This is convenient when you actually know what you’re doing, but it also means that you could conceivably render your system unusable within seconds. New to the Linux command line? No worries. With those two resources, you’ll familiarize yourself with the command line in no time. But whether you’re a Linux newbie or veteran, you should never run a command unless you know exactly what it does. Here are some of the deadliest Linux commands that you’ll, for the most part, want to avoid. Delete Recursively The Linux ability to delete anything you want without question is a godsend, especially after dealing with years of “That file can’t be deleted” errors in Windows. But Internet trolls will be quick to deceive you, presenting you with extremely dangerous removal commands that can wipe entire hard drives. rm -rf / This line executes the remove command rm with two toggles: -r which forces recursive deletion through all subdirectories and -f which forces deletion of read-only files without confirmation. The command is executed on the / root directory, essentially wiping your whole system clean.

Continue reading

Cheat – Command Line Cheat-Sheet for Linux cmd Nerds

Was Sie tun, wenn Sie sich nicht sicher sind, welchen Befehl Sie ausführen müssen, insbesondere bei komplexen Befehlen, die viele Optionen mit verwenden. Die meisten verwenden dazu dann Manpages, um in solchen Situationen Hilfe zu erhalten. Einige der anderen Optionen können Befehle wie ’ help ‘, ’ whereis ’ und ’ whatis ’ sein. Aber alle haben ihre Vor- und Nachteile. Beim Durchsuchen von Manpages nach Optionen und Hilfe ist die Beschreibung in Manpages zu lang, um sie in kurzer Zeit zu verstehen. Linux Man Pages In ähnlicher Weise liefert der Befehl ‘help’ möglicherweise nicht die gewünschte Ausgabe. Hilfe command Ein ‘whereis’-Befehl sagt kaum etwas anderes als den Speicherort der installierten Binärdateien aus (kann zur Zeit wichtig sein). whereis command Ein ‘whatis’-Befehl gibt eine strenge und einzeilige Antwort, die nicht viel hilfreich ist, außer den Zweck des Befehls anzuerkennen. Außerdem sagt er kein einziges Wort über die verfügbaren Optionen. whatis command Wir haben alle diese Optionen bis heute genutzt, um unser Problem im Dilemma zu lösen, aber hier kommt eine interaktive Spickzettel-Anwendung “Cheat”, die den Rest führen wird. Was ist Cheat? Cheat bietet einfache Befehlsoptionen und ist eine interaktive Cheat-Sheet-Anwendung, die unter der GNU General Public License für Linux-Befehlszeilenbenutzer veröffentlicht wurde.

Continue reading

Cracking Wifi WPA/WPA2 passwords using pyrit cowpatty– with cuda or calpp in Kali Linux

There are just too many guides on Cracking Wifi WPA/WPA2 passwords using different methods. Everyone has their own take on it. Personally, I think there’s no right or wrong way of cracking a Wireless Access Point. Following way is my way and I found it extremely efficient and fast during my tests for Cracking Wifi WPA/WPA2 passwords using pyrit cowpatty in Kali Linux where I attacked with Dictionary using either cuda or calpp (cal++) and at the same time I used WiFite to fast track a few things. This whole process was used in Kali Linux and it took me less than 10 minutes to crack a Wifi WPA/WPA2 password using pyrit cowpatty WiFite combination using my laptop running a AMD ATI 7500HD Graphics card. You can make the following process faster like I did. If you have an AMD ATI Graphics card you’ll have to follow these guides below: Contents Cracking Wifi WPA/WPA2 passwords using pyrit cowpatty– with cuda or calpp in Kali Linux NVIDIA Users: AMD Users: Capture handshake with WiFite Create ESSID in Pyrit Database Import Dictionary in Pyrit Create tables in Pyrit using batch process Cracking Process Attack a handshake with PMKs from the db using Pyrit Attack a handshake with passwords from a file or Dictionary using Pyrit Crack using Cowpatty Export to cowpatty Let it rip: Crack WPA WPA2 PSK password using cowpatty Attack a handshake with PMKs from a cowpatty-file using Pyrit Cleanup Pyrit and database Conclusion Cracking Wifi WPA/WPA2 passwords Related NVIDIA Users: Install proprietary NVIDIA driver on Kali Linux – NVIDIA Accelerated Linux Graphics Driver Install NVIDIA driver kernel Module CUDA and Pyrit on Kali Linux – CUDA, Pyrit and Cpyrit-cuda AMD Users: Install AMD ATI proprietary fglrx driver in Kali Linux 1.

Continue reading

Dateien finden mit dem Befehl: find

Wie finde ich die neuesten Dateien unter Linux? Ein Programm schreibt jedem Menge Logdateien mit cryptischen Dateinamen. Wie findet man die letzte Logdatei? Wie finde ich die letzten Dateien in meinem Browser-Cache? ls -ltr Der ls-Befehl kann Dateien nach dem (Modifikations-) Datum (time) sortieren (Option -t). Die Option -r /reverse) dreht das Ergebnis einfach um. Mit ls -ltr werden einfach alle Dateien in einem Verzeichnis umgekehrt nach der Zeit sortiert. Die neuesten (und wichtigsten) Dateien stehen dann am Ende des Listings. Wenn das Verzeichnis viele Dateien enthält, lässt man das Listing einfach an sich vorbeirauschen, die wichtigsten Dateien stehen unten. Analog findet ls -lSr Übrigens die größten Dateien (-S: sort by size). Nur die letzte Datei finden Die neueste Datei findet man z.B. in shell-Skripten zusammen mit tail. Die -l (long) Option stört an dieser Stelle und macht es nur kompliziert. last=`ls -tr | tail -1` if [ -z "$last" ] then echo "keine Datei gefunden" else echo "letzte Datei: $last" fi Suchen in Unterverzeichnissen Bei der Suche in Unterverzeichnissen helfen find und xargs. Firefox organisiert seinen Cache in Unterverzeichnissen. Welches ist die zuletzt heruntergeladene Datei? cd ~/.mozilla/firefox/\*/Cache # In das Cache Verzeichnis wechseln find . -type d | xargs ls -ltrd # nur neueste Verzeichnisse suchen # (ls -d: Verzeichnisinhalt nicht anzeigen)

Continue reading

Denial-of-service Attack

Denial-of-service Attack – DOS using hping3 with spoofed IP in Linux In computing, a denial-of-service (DoS) or distributed denial-of-service (DDoS) attack is an attempt to make a machine or network resource unavailable to its intended users. Although the means to carry out, the motives for, and targets of a DoS attack vary, it generally consists of efforts to temporarily or indefinitely interrupt or suspend services of a host connected to the Internet. As clarification, distributed denial-of-service attacks are sent by two or more persons, or bots, and denial-of-service attacks are sent by one person or system. As of 2014, the frequency of recognized DDoS attacks had reached an average rate of 28 per hour. Perpetrators of DoS attacks typically target sites or services hosted on high-profile web servers such as banks, credit card payment gateways, and even root DNS-Nameserver’s. Denial-of-service threats are also common in business, and are sometimes responsible for website attacks. This technique has now seen extensive use in certain games, used by server owners, or disgruntled competitors on games, such as popular Minecraft servers. Increasingly, DoS attacks have also been used as a form of resistance. Richard Stallman has stated that DoS is a form of ‘Internet Street Protests’.

Continue reading

Fritzbox: Datenverkehr mitschneiden

Über eine versteckte Funktion können Sie mit Ihrer Fritzbox den Datenverkehr mitschneiden. So kommen Sie Problemen und mysteriösen Aktivitäten in Ihrem Netzwerk auf die Schliche. Wir zeigen Ihnen, wie’s geht. Datenverkehr mit der Fritzbox aufzeichen Datenverkehr in der Fritzbox Grundsätzlich kann jeder mit der Fritzbox den Datenverkehr aufzeichnen. Die Auswertung der Daten ist jedoch kompliziert und nur etwas für fortgeschrittene Nutzer. Sie können den Datenverkehr aber selbst mitschneiden und das Ergebnis an einen Experten senden, der es für Sie auswertet. Öffnen Sie den folgenden Link, über den Sie direkt zum Datenmitschnitt der Fritzbox gelangen. Loggen Sie sich hier mit Ihrem Passwort ein. Nun können Sie nach Belieben verschiedene Schnittstellen Ihres Netzwerks mitschneiden. Wählen Sie zwischen den Oberpunkten “Internet”, “Netzwerkschnittstellen”, “WLAN”, “USB” und “DTrace”. Um die Aufzeichnung zu starten, klicken Sie auf die Schaltfläche “Start” neben der gewünschten Schnittstelle. Es beginnt nun ein Download, der erst abgeschlossen wird, wenn Sie auf “Stopp” klicken. Der Download wird daraufhin beendet und die Datei kann ausgelesen werden. Datenverkehr der Fritzbox mit Wireshark auswerten Datenverkehr mit Wireshark Laden Sie sich das kostenlose Programm “Wireshark” herunter und installieren Sie es. Wählen Sie bei der Installation die Zusatz-Software “WinPcap” ab. Diese wird nicht benötigt. Starten Sie das Programm und klicken Sie oben links auf “File” und anschließend auf “Open”.

Continue reading

Hacker Angriffsarten

Hacker Angriff: Asynchrone State Gefahr: Maskerade Dieser Angriff [Joncheray 95] basiert auf dem Versuch, einen asynchronen Zustand auf beiden Seiten der TCP-Verbindung zu erzwingen, durch den der Angreifer Pakete erstellen kann, die auf beiden Seiten als echte Pakete akzeptiert werden. Dieser Angriff ist durch Verkehrsüberwachung zu erkennen. Die einzige Möglichkeit, sich vor diesem Angriff zu schützen, ist, die Daten zu verschlüsseln und zu signieren. Hacker Angriff: Ausführbarer Code Gefahr: Manipulation Über HTTP können Java-Applets und ActiveX Controls übertragen werden. Außerdem dient das Multipurpose Internet Mail Extensions Protocol (MIME) dazu, den Aufbau einer Seite im HTML-Format zu beschreiben. Somit ist ausführbarer Code eine wesentliche Gefahr, die von HTTP ausgeht. Proxies können HTTP-Nachrichten auf ausführbaren Code untersuchen. Hacker Angriff: Ausführbarer Code Gefahr: Manipulation, Eindringen Je nach Konfiguration könnte Software im FTP-Bereich manipuliert sein - besonders, wenn es sich um ausführbaren Code handelt. Ist ein Angreifer in der Lage, ausführbare Programme auf ein fremdes System zu bringen, so kann er dort “Trojanische Pferde” installieren. Dies können Programme sein, die intern Information sammeln und diese möglichst unbemerkt nach außen zurück zum Angreifer schmuggeln. Sie verstecken sich in einem scheinbar nützlichen ausführbaren Programm. Dieses kann per FTP angeboten oder per Mail verschickt werden - in jedem Fall muss der Empfänger dazu motiviert werden, das Programm zu starten.

Continue reading

Leserliche Ausgabeformate

Leserliche Ausgabeformate Viele Linux-Kommandos, die Dateigrößen anzeigen, wie etwa der Directory-Lister ls oder die Anzeige des freien Plattenspeichers df, liefern als Standard ein Ergebnis, das für menschlichen Gebrauch realtiv ungeeignet ist. Das muß auch so sein, weil viele Skripts diese Ergebnisse der Kommandos aufnehmen und weiterverarbeiten. Um dennoch lesbare Ergebnisse zu erreichen, verfügen viele Programme über den Parameter -h, wie “human”, der beispielsweise statt “7533549” die Variante “7.5G” ausgibt.

Continue reading

Linux CMD Tastatur Befehle

Linux CMD Tastatur Befehle Ins vorherige Verzeichnis Wechseln: cd - Insert the last argument from the previous command [ESC]+.That’s hold down escape and press . This is a great one if you’re processing a file in multiple steps. The result file is often the last argument of a command then is will be an argument of the next command. Hier ist ein Beispielspromt PS1="\[\e[30;1m\]\u@\h:\[\e[34;1m\]\w\n\`if [ \$? = 0 ]; then echo \[\e[30m\]! \!\[\e[30m\]\$; else echo \[\e[31m\]! \!\[\e[30\;0m\]\$; fi\` \[\e[0m\\]"It looks like this: user@host:****/current/working/directory ! 506$ If the command you run returns an exit status that’s not 0, i.e. it fails, then it looks like this user@host:****/current/working/directory ! 506$ CMD Shortcuts Here’s the top shortcuts I use on the command line. These should speed up your productivity quite nicely. If you’re using the Gnome Terminal on Ubuntu (possibly other distro’s too) you might need to enable ALT+f and ALT+b in the preferences. ESC + .Escape key and the period/full stop at the same time will insert the last argument from the previous command. For example if your previous command is: echo Hello World Then this shortcut will insert ‘World’ and the current point. However, if your previous command was echo "Hello World" Then it will insert ‘“Hello World”’.

Continue reading

Linux Tastenkombinationen

Strg Alt F1 Ctrl Alt F1 Switch to the first text terminals. Under Linux you can have several (6 in standard setup) terminals opened at the same time. This is a keyboard shortcut, which means: “press the control key and the alt key, hold them. Now press F1. Release all keys.” ​ Ctrl Alt Fn (n=1..6) Switch to the nth text terminal. (The same could be accomplished with the rarely used command chvt n. “chvt” stands for “change virtual terminal”). In text terminal (outside X), you can also use Alt Fn (the key Ctrl is not needed). tty Print the name of the terminal in which you are typing this command. If you prefer the number of the active terminal (instead of its name), it can be printed using the command fgconsole (=“foreground console”). Ctrl ​ Alt F7 Switch to the first GUI terminal (if X-windows is running on the 7th terminal, where it typcially is). Ctrl ​ Alt Fn (n=7..12) Switch to the nth GUI terminal (if a GUI terminal is running on screen n-1). On default, the first X server is running on terminal 7. On default, nothing is running on terminals 8 to 12–you can start subsequent X server there.

Continue reading

Midnight-Commander Templates

1) Rot-Grau - Editor Schwarz [Colors] base_color=normal=lightgray,red:input=white,brown:errors=white,brightred:gauge=brown, black:selected=black,white:marked=yellow,red:markselect=yellow,white:directory=white, red:executable=brightgreen,red:link=lightgray,red:device=brightmagenta,red:special=brightmagenta, red:core=brightred,red:menu=black,white:menuhot=yellow,white:menuhotsel=brightred, black:dnormal=black,white:dfocus=white,lightgray:dhotnormal=yellow, white:dhotfocus=brightred,lightgray:editnormal=lightgray,black:editmarked=yellow,white 2) Gelb Schwarz - Editor schwarz [Colors] base_color=gray,black:normal=yellow,black:menu=yellow,gray:viewunderline=black, green:editnormal=white,black:editmarked=black,white:menuhot=red,gray:directory=brightred, gray:executable=brightgreen,gray:device=white,gray:input=yellow,gray:link=brightcyan, gray:stalledlink=white,gray:reverse=brightmagenta,black:selected=black, yellow:marked=yellow,brown:markselect=black,magenta 3) Schwarz-Weiß-Türkis Template - Editor schwarz [Colors] base_color=normal=white,default:directory=white,default:marked=yellow,default:selected=gray, white:executable=brightgreen,default:link=lightgray,default:stalelink=brightred, default:special=brightblue,default:device=magenta,default:editnormal=white,default 4) Schwarzes Template - Editor gleich blau [Colors] base_color=normal=,default:selected=,:marked=,default:markselect=,:menu=,:menuhot=, :menusel=,:menuhotsel=,:dnormal=,:dfocus=,:dhotnormal=,:dhotfocus=,:input=,:reverse=,:executable=, default:directory=,default:link=,default:device=,default:special=,:core=,:helpnormal=,:helplink=,:helpslink=,: 5) Grün-blau - Editor schwarz [Colors] base_color=lightgray,green:normal=green,default:selected=white,gray:marked=yellow, default:markselect=yellow,gray:directory=blue,default:executable=brightgreen, default:link=cyan,default:device=brightmagenta,default:special=lightgray,default:errors=red, default:reverse=green,default:gauge=green,default:input=white,gray:dnormal=green, gray:dfocus=brightgreen,gray:dhotnormal=cyan,gray:dhotfocus=brightcyan, gray:menu=green,default:menuhot=cyan,default:menusel=green,gray:menuhotsel=cyan, default:helpnormal=cyan,default:editnormal=green,default:editbold=blue, default:editmarked=gray,blue:stalelink=red,default 6) Türkis-Gelb gut [Colors] color_terminals=linux,xterm,gnome-terminalbase_color=normal=cyan,black:directory=yellow,black:selected=blue, cyan:marked=brightcyan,brown:menu=blue,cyan:link=green,black:executable=brightmagenta, black:core=red,black:editnormal=cyan,black:editbold=yellow,black:editmarked=magenta, white:dnormal=green,black:dfocus=white,green:dhotnormal=yellow,black:dhotfocus=green, black:helpnormal=yellow,blue:helpslink=white,green:helplink=white,blue:gauge=white,green:input=white,red: Midnight Commander + 7zip Download p7zip_4.42_src_all.tar.bz2 (p7zip homepage). Extract the file "contrib/VirtualFileSystemForMidnightCommander/u7z" and copy it to /usr/share/mc/extfs/ Edit /usr/share/mc/extfs/extfs.ini to add "u7z" after urar. Edit /usr/share/mc/mc.ext to add : ​ regex/.(7z|7Z)$ View=%view{ascii} 7za l %f Open=%cd %p#u7z Midnight Commander Verzeichnisse und Dateien /usr/share/mc/mc.hlp ​ The help file for the program. /usr/share/mc/mc.ext ​ The default system-wide extensions file. ~/.mc/bindings ​ User’s own extension, view configuration and edit configuration file. They override the contents of the system wide files if present. /usr/share/mc/mc.ini ​ The default system-wide setup for the Midnight Commander, used only if the user doesn’t have his own ~/.mc/ini file. /usr/share/mc/mc.lib ​ Global settings for the Midnight Commander. ​ Settings in this file affect all users, whether they have ~/.mc/ini or not. Currently, only terminal settings are loaded from mc.lib. ~/.mc/ini ​ User’s own setup.

Continue reading

MJPG-Streamer

MJPG-Streamer Zum Verständnis dieses Artikels sind folgende Seiten hilfreich: Ein Terminal öffnen Programme kompilieren Ein Programm starten MJPG-Streamer ist ein Werkzeug für die Kommandozeile, mit dem sich Videodaten von einer Webcam oder einer anderen Videoquelle als Motion-JPEG (M-JPEG/MJPG) streamen lassen. Während moderne Netzwerkkameras einen solchen Stream automatisch erzeugen, kann mit Hilfe des Programms auch eine einfache Webcam mittels eines Rechners mit Internet-Zugang zu einer solchen umfunktioniert werden. Voraussetzungen Zum Betrieb eines Webstreams muss die Webcam zunächst korrekt eingerichtet sein. Bei einigen Modellen muss zunächst ein Treiber für Video 4 Linux 2 installiert werden. Wenn die Kamera aber unter anderen Programmen funktioniert, entfällt dieser Schritt. Installation MJPG-streamer ist nicht in den offiziellen Paketquellen enthalten und muss selber kompiliert werden, dafür werden folgende Pakete benötigt: build-essential libjpeg-dev imagemagick subversion libv4l-dev (optional) checkinstall (optional) Paketliste zum Kopieren: sudo apt-get install build-essential libjpeg-dev imagemagick subversion libv4l-dev checkinstall sudo aptitude install build-essential libjpeg-dev imagemagick subversion libv4l-dev checkinstall Der aktuelle Quelltext wird aus dem SVN-Projektarchiv heruntergeladen svn co https://mjpg-streamer.svn.sourceforge.net/svnroot/mjpg-streamer mjpg-streamer Nun wechselt man in das erstellte Verzeichnis mjpg-streamer/mjpg-streamer. ​ cd mjpg-streamer/mjpg-streamer und kompiliert bzw. installiert das Programm entweder auf die klassische Weise ​ make sudo make install oder mit checkinstall (dann kann das Programm leicht wieder deinstalliert werden).

Continue reading

mod_rewrite aktivieren

Lösung oder Tipp zum aktivieren des Apache Moduls mod_rewrite unter SUSE Linux 10.3: Dieses Modul ist unter anderem wichtig, damit ein Apache Webserver die Fähigkeit erhält URL’s der Form php?=352354?abec=3453 in eine Suchmaschinen “freundliche” Form wie datei.html zu bringen. Getestet bei SUSE Linux 10.0 - 10.3 mit Plesk 8 - 8.3 (bei Strato) Es reicht nur ein Befehl reicht: root:/# a2enmod rewrite Danach Apache neustarten: root:/# rcapache restart Oder gleich den Server neustarten: root:/# reboot Natürlich kann man andere Apache Module auch so laden (ohne das “mod_” davor) und wieder entfernen mit dem Befehl: a2dismod .....

Continue reading

Portscanner-nmap

Portscanner wie nmap sind eines der wichtigsten Arbeitsmittel von Administratoren. Dieses HowTo beschreibt den Einsatz des populären Portscanner Nmap unter Linux & Windows Systemen. Protokolle & Ports Um einen Dienst auf einen IP-Host eindeutig zu identifizieren werden drei Angaben benötigt: das Protokoll (z.B. TCP) die IP-Adresse (z.B. 10.0.0.1) die Portnummer (z.B. 80 für HTTP) Diese drei Angaben identifizieren einen Webserver (HTTP) der auf dem Host mit der IP-Adresse 10.0.0.1 läuft. Die Portnummer ist eine 16-Bit-Zahl zwischen 0 und 65535. Für Standarddienste werden die Portnummern von der IANA vergeben. Dort finden Sie auch die aktuelle Liste der Portnummern. Die Aufgabe eines Portscanners ist es nun, die offenen Ports eines Systems zu ermitteln. Also die Ports, auf denen ein Service angeboten wird. Beispiel: Sehen wir uns dazu ein erstes Beispiel an. [root] ~ $ nmap -sT lxu.io Starting nmap 3.20 ( www.insecure.org/nmap/ ) at 2005-03-01 18:18 CEST Interesting ports on lxu.io (10.0.0.1): (The 1610 ports scanned but not shown below are in state: closed) Port State Service 80/tcp open http Nmap run completed -- 1 IP address (1 host up) scanned in 9.966 seconds Mit dem Linux Kommando: nmap -sT lxu.io untersucht nmap den Host lxu.io auf offene TCP-Ports. Dabei überprüft nmap standartmässig nicht alle 65535 TCP-Ports.

Continue reading

Wichtige /var/log/ Logdateien

Wenn Sie viel Zeit in einer Linux-Umgebung verbringen, ist es wichtig zu wissen, wo sich die Logdateien befinden und was in jeder Protokolldatei enthalten ist. Wenn Ihre Systeme reibungslos funktionieren, nehmen Sie sich etwas Zeit, um den Inhalt verschiedener Logdateien zu erlernen und zu verstehen. Dies hilft Ihnen bei Krisen und Sie müssen die Logdateien durchsehen, um das Problem zu identifizieren. /etc/rsyslog.conf steuert, was in einigen Logdateien enthalten ist. Im Folgenden finden Sie beispielsweise den Eintrag in der Datei rsyslog.conf für /var/log/messages. grep "/var/log/messages"/etc/rsyslog.conf *.info;mail.none;authpriv.none;cron.none /var/log/messages In der obigen Ausgabe * .info gibt an, dass alle Protokolle vom Typ INFO protokolliert werden. mail.none, authpriv.none, cron.none gibt an, dass diese Fehlermeldungen nicht in der Datei /var/log/messages protokolliert werden sollten. Sie können auch * .none angeben, was darauf hinweist, dass keine der Protokollnachrichten protokolliert wird. Im Folgenden sind die 20 verschiedenen Logdateien aufgeführt, die sich im Verzeichnis/var/log/ befinden. Einige dieser Logdateien sind verteilungsspezifisch. Beispielsweise wird dpkg.log auf Debian-basierten Systemen (z. B. unter Ubuntu) angezeigt. /var/log/messages - Enthält globale Systemnachrichten, einschließlich der Nachrichten, die beim Systemstart protokolliert werden. Es gibt verschiedene Dinge, die in /var/log/messages angemeldet sind, einschließlich Mail, Cron, Daemon, Kern, Auth usw. /var/log/dmesg - Enthält Informationen zum Kernel-Ringpuffer. Beim Systemstart wird eine Anzahl von Meldungen auf dem Bildschirm gedruckt, auf denen Informationen zu den Hardwaregeräten angezeigt werden, die der Kernel während des Startvorgangs erkennt.

Continue reading

Ansible AD HOC Command Examples – Ansible Cheat Sheet

Ansible AD HOC Command Examples - Ansible Cheat Sheet Excerpt Ansible ad hoc commands are one-liners designed to achieve a very specific task they are like quick snippets and your compact swiss army knife when you want to do a quick task across multiple machines. Simply put, Ansible ad hoc commands are single-line Linux shell commands, and a playbook is like a shell script, a collection of multiple commands with logic. Ansible special commands are single lines designed to accomplish a very specific task. They are like quick extractors and your compact Swiss army knife when you want to complete a task quickly on multiple machines. Simply put, Ansible ad hoc commands are single-line Linux shell commands, and a playbook is like a shell script, a collection of multiple commands with logic. Ansible special commands are useful when you want to perform a quick task. We’ve collected over 20 examples that will help you get started with Ansible AD HOC commands. This is your Ansible AD HOC command cheat sheet or Ansible cheat sheet. Prerequisites Must install Ansible (only on the control machine, remember there is no agent) Some remote virtual machines to test, you can use vagrant to build them.

Continue reading

Ansible apt module Examples - install with apt

Excerpt Ansible APT Package manager is an Ubuntu equivalent for RedHat yum package manager. Just like all other ansible modules apt ansible module is built after one specific unix command of Debian apt-get It is always recommended to choose the modules rather using the raw unix commands over the shell module as it would bring more standard and fault tolerance to your Ansible Playbook The Ansible APT package manager is the Ubuntu equivalent of the RedHat yum package manager. Just like all other Ansible ‘apt’ modules, the Ansible module is built after the Debian-specific Unix ‘apt-get’ command You should choose modules instead of using raw Unix commands instead of shell modules as this will bring more standards and fault tolerance to your Ansible Playbook. So how to use apt ansible module in playbook or in special way. GOOD!. This article will cover the ansible apt module in detail with various examples. Introduction to ansible apt module Ansible apt module manages apt packages in Debian or Ubuntu systems. In typical Ubuntu machine, in order to install a package, you would execute the following command apt install nginx Same way here in ansible, the following playbook/play would do that for you

Continue reading

Ansible Command Module Examples

Excerpt Ansible Command module is used to execute commands on a remote node. The Command module is mainly used to execute simple Linux commands on a remote node/server that is part of a server group or a standalone server mentioned in the server group. If you want to run some simple shell commands on a remote server, you can use Ansible Command Module Examples The Ansible Command module is used to execute commands on the remote node. The Command module is mainly used to execute simple Linux commands on a remote node/server that is part of a server group or a standalone server mentioned in the server group. If you want to run some simple shell commands on a remote server, you can use this Ansible command module . But when there are no overly complicated shell commands or two commands concatenated with PIPE. you cannot use this command module and you must choose the shell module instead of this one. Not just a pipe, if you use one of these characters like | > < in your command you should consider using the shell module Where to use Ansible SHELL and Where to use Ansible COMMAND? ls -lrt /etc/httpd/conf is simple and can be executed with Ansible command module

Continue reading