From the course: Cert Prep LPIC-1 Exam 102 (Version 5.0)
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Create a monitor script - Linux Tutorial
From the course: Cert Prep LPIC-1 Exam 102 (Version 5.0)
Create a monitor script
- [Narrator] Now, we're going to put together a lot of things we've talked about by creating a script that monitors failed logins, and if the number is higher than a threshold, we'll email the administrator. This script is in the exercise files directory for this chapter. You can either load that script into VI to look at it or create it as I discuss the details. If you wanted the script to run automatically every day, you could create a cron job for it, place it in the etc/cron.daily directory, or even create systemd.timer and service units for it. To run it you'll need to elevate privileges using sudo. We'll start by discussing the first ten lines of the script, and then we'll follow up with lines 14 to the end. If you load this into VI you can turn on line numbering by pressing escape, colon, and typing set, space, number. On the first line we have our hash, bang, /bin/bash line to call the correct interpreter. On line…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Introduction to Bash2m 9s
-
(Locked)
What is a shell script?3m 57s
-
(Locked)
Execute compound commands5m 59s
-
(Locked)
Use Command and Variable substitution6m 21s
-
(Locked)
Conditional flow with if, then if3m 12s
-
(Locked)
Conditional flow with case2m 21s
-
(Locked)
Iterate with for loops2m 42s
-
(Locked)
Iterate with while loops1m 30s
-
(Locked)
Using return codes6m 32s
-
(Locked)
Create a monitor script3m
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-