You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
-
# Monitor Linux Server
1
+
# Monitor Linux/Ubuntu Server (04/2020)
2
2
This is a python2 script which can be used to monitor Linux/Ubuntu/Unix server CPU, Memory and Disk utilization and issue warning as emails in the case of exceeding utilization thresholds defined. Simple and easy to understand script to a person who has basic python coding skills. Feel free to contribute for greater features.
3
3
4
-
# Instructions
4
+
##Instructions
5
5
6
-
You can find a function name analyze_server in the server_health_monitor.py file. You write a suiltable main method and call this function inside with the suitable parameters. Script will report the current CPU, RAM and Disk utilization value to a ServerHealth.log file in the sepecified location in the parameter.
6
+
You can find a function name analyze_server in the server_health_monitor.py file. Write a suiltable main method and call this function inside with the suitable parameters. Script will report the current CPU, RAM and Disk utilization values to a ServerHealth.log file in the sepecified location in the parameter.
7
7
8
-
## Example main method
8
+
###Example main method
9
9
```
10
10
def main():
11
11
# Consider:
@@ -29,7 +29,7 @@ if __name__=="__main__":
29
29
30
30
You can add a similar main method to server_health_monitor.py file and schedule a cron job to run periodically. By having ServerHealth.log file in a STATIC location (location where you can access from outside), will ease you to monitor the server. However, you will receive an email whenever the thresholds are reached.
31
31
32
-
# Test the script before scheduling a cron job
32
+
##Test the script before scheduling a cron job
33
33
Navigate to the location where the server_health_monitor.py is located.
34
34
```
35
35
sudo chmod -R 777 server_health_monitor.py
@@ -41,7 +41,7 @@ pip install library_name
41
41
```
42
42
If the execution is successfull, script will results nothing to the console but ServerHealth.log file.
43
43
44
-
# How to schedule a cron job to run the script in every 15 min
44
+
##How to schedule a cron job to run the script in every 15 min
45
45
46
46
Open ssh to server:<br/>
47
47
```
@@ -52,4 +52,4 @@ Add following entry at the end of file and save.<br/>
0 commit comments