When you have servers, automating tasks is always useful, it saves us time and also helps with fault tolerance, you know… «do such a thing in case of low ram » ... "restart such service if such socket fails»... etc, the detail is that to automate tasks, the first thing is to know the current status of the server.
Script to display information from our system
I had told you about a script which was showing Apache RAM consumption statistics, this time I will tell you about a script that displays this information:
- Is or is not connected to the internet
- Operating system
- Distro
- Architecture
- Kernel
- Hostname
- Internal IP
- External IP
- DNS you use
- Logged users
- RAM and SWAP statistics
- HDD space
- Time it took for the script to display the information
- Uptime
How to obtain Script that shows information from our system
The first thing is to download it, then give it execution permissions, finally we execute it with the -I parameter so that it is installed in our system and it is easier to execute it in the future. Open a terminal and put the following commands:
wget http://tecmint.com/wp-content/scripts/tecmint_monitor.sh chmod + x tecmint_monitor.sh ./tecmint_monitor.sh -I
It will ask us for the password, we type it, press Enter and that's it, we can see the information of our system by executing:
monitor
Examples of information provided by the Script:
As you can see in the commands, the author of the script is TecMint.com, thanks Avishek Kumar for post it.
Well I hope nothing will be useful to you 😉
Hey.
I followed the steps described and when I wrote ./tecmint_monitor.sh -I it tells me that the option is invalid… The message is ./tecmint_monitor.sh: illegal option - I
Can you help me?
regards
It is lowercase i.
The parameter is an i-latin, not an ele 🙂
Anyway, the script fails me because of the line containing "su -c", since in Ubuntu sudo is used to obtain root permissions.
and what happens that the «sudo su -« does not work
Edit the file (sudo nano / usr / bin / monitor) and on line 75 it says "hostname -I" ... remove the -I and you're done
try this way
./tecmint_monitor.sh -i
Anyway, if you run the script without parameters, it gives you the corresponding information. What it does internally is copy the script "tecmint_monitor.sh" in / usr / bin / with name "monitor" (with execution permissions).
i put it on a ubuntu server 12.04 and i get this error
Downloads / tecmint_monitor.sh: 26: Downloads / tecmint_monitor.sh: [[: not found
Downloads / tecmint_monitor.sh: 36: Downloads / tecmint_monitor.sh: [[: not found
Downloads / tecmint_monitor.sh: 43: Downloads / tecmint_monitor.sh: [[: not found
I have execution permissions and I put the parameter -I, what could be the cause of the problem?
Interesting Post, a good way to automate requests for information, while saving time that can be used on other issues.
off topic: @ KZKG ^ Gaara, can you please reply to the emails, which is not that complicated.
GREETINGS
What emails? 😀
great article.
but as I find myself?
wget http://tecmint.com/wp-content/scripts/tecmint_monitor.sh
chmod + x tecmint_monitor.sh
./tecmint_monitor.sh -I
I'm not going ..
The two that I sent you a few weeks ago did not bounce back, so the email you gave me in FLISOL is correct ...
Write me again to see 0_oU
Check to see if it arrived
Great!! It's great, although it could be supplemented with extra information. Although yes, it is easy to customize. Thanks for sharing!
A very useful tool that is also used to monitor services and resources, in addition to being able to set actions based on things, as well as sending alerts for example is monit:
https://mmonit.com/monit/
SHUT UP AND TAKE MY FIRE KEY!
http://pastebin.com/uKRsrPvZ
in case it is more understandable 😉
regards
apt-get install inxi
run in console:
inxi-Fxz
And ready…
the "./tecmint_monitor.sh -I" gives me an error, I changed it to lowercase as @Edgar Pérez said but then "monitor" appears as an unknown command: /
What am I doing wrong? u__ú
It seems that it is incorrectly installed. I have Debian, but I have sudo configured as in Ubuntu, that is, I do not have a password assigned to the root user and, therefore, I do not have the password that I am asked to enter during installation. If I enter my username, the installation fails, because it is not the root password. This worked for me:
chmod + x tecmint_monitor.sh
sudo su
./tecmint_monitor.sh -i
Thus it was effectively installed. Then just run in any terminal: monitor
mmm ... it will be time to try it
The script is good, but in the RAM memory used it marks a not very credible value. When in any system monitor I see that I have used 370 MB, this script indicates that it is 991 MB (?).
The script is fine but with inxi it shows you more data.
Excellent!!
It is perfect for me to stop pulling the commands one by one in the console when I have to perform an administration task. 🙂
Too bad it is not on GitHub to be able to forge it and be able to work on the script more comfortably.
Regards!
Deluxe.
Thanks for sharing.
Regards!
Alejo, check this out: http://blackhats.cubava.cu/2015/05/15/script-que-muestra-informacion-de-nuestro-sistema/
this is fine, although not quite