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

Create a monitor script - Linux Tutorial

From the course: Cert Prep LPIC-1 Exam 102 (Version 5.0)

Start my 1-month free trial

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…

Contents