Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

anged files with 757 additions and 0 deletions. Homework 1/README.md L 2-2,+1,81 ee # Homework 1 The purpose of this homework is to develop a

image text in transcribed
image text in transcribed
anged files with 757 additions and 0 deletions. Homework 1/README.md L 2-2,+1,81 ee # Homework 1 The purpose of this homework is to develop a bash script that uses the ping command to test whether a device is online. The results of this script should be logged with a timestamp. The script should be run as a cron job. If a server is not responding, email the system administrator (you) # Useful commands ### ping console ping 192.168.1.1 -03 ping google.com -23 cut Split a string using the percentage sign and get the first part of the split: console echo 100% awesome cut -fi Get the second split: console echo "1001 awesome" | cut - - 2 Split using space instead of percentage: console echo 10 awesome I cut o f al from mailutils package) mail (from mailutils package) + Set up a local account (you will see the prompts when installing 10 "bash to send a message using echo + echo "message body" | mail -s "subject" lenglee, local + # check mail with: + cat /var/mail/lee + ** Script functionality . . Create a function that accepts an IP address or hostname as an argument - Parse the output of the ping command + - Check the output status - If the ping is not responding or is missing packets, report this to the log + and send an email + If the ping is high latency, report this to the log and send an email If the device is normal, report this to the log The script should run every five minutes. Scoring + 1. Ping devices (3 pts) + show that the script pings addresses + You should ping at least 3 addresses. One of the addresses + should contain your walbany Netid. For + example, NetID of AB123456 should ping 12.34.56.1 **** 2. Log information (2 pts) Show the log file with script output. The logs should have a . timestamp for each entry ** . 3. mail when getting errors (3 pts) Show the emails you receive from the failed pings for the cut of service IP address + * 4. Run task at regular intervals (3 pts) Show conta and the log file with regular intervals baission Subait code and screenshots demonstrating the code functionality to the Github Course (https://class . thub.co/a/a c ). anged files with 757 additions and 0 deletions. Homework 1/README.md L 2-2,+1,81 ee # Homework 1 The purpose of this homework is to develop a bash script that uses the ping command to test whether a device is online. The results of this script should be logged with a timestamp. The script should be run as a cron job. If a server is not responding, email the system administrator (you) # Useful commands ### ping console ping 192.168.1.1 -03 ping google.com -23 cut Split a string using the percentage sign and get the first part of the split: console echo 100% awesome cut -fi Get the second split: console echo "1001 awesome" | cut - - 2 Split using space instead of percentage: console echo 10 awesome I cut o f al from mailutils package) mail (from mailutils package) + Set up a local account (you will see the prompts when installing 10 "bash to send a message using echo + echo "message body" | mail -s "subject" lenglee, local + # check mail with: + cat /var/mail/lee + ** Script functionality . . Create a function that accepts an IP address or hostname as an argument - Parse the output of the ping command + - Check the output status - If the ping is not responding or is missing packets, report this to the log + and send an email + If the ping is high latency, report this to the log and send an email If the device is normal, report this to the log The script should run every five minutes. Scoring + 1. Ping devices (3 pts) + show that the script pings addresses + You should ping at least 3 addresses. One of the addresses + should contain your walbany Netid. For + example, NetID of AB123456 should ping 12.34.56.1 **** 2. Log information (2 pts) Show the log file with script output. The logs should have a . timestamp for each entry ** . 3. mail when getting errors (3 pts) Show the emails you receive from the failed pings for the cut of service IP address + * 4. Run task at regular intervals (3 pts) Show conta and the log file with regular intervals baission Subait code and screenshots demonstrating the code functionality to the Github Course (https://class . thub.co/a/a c )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

Students also viewed these Databases questions

Question

What is at stake in these negotiations? LO.1

Answered: 1 week ago