Answer the question
In order to leave comments, you need to log in
How to collect statistics from the server?
How can I implement the collection of information on the server, but you can’t install third-party software, maybe some kind of .sh In general, you need the version of centos, the size of the database file, the percentage of free disk space and running services.
A lot of servers will have to be reduced to a table that, for example, wakes up to collect information every day.
Help, what ideas can you suggest!? Thank you!
Answer the question
In order to leave comments, you need to log in
Install ansible (it is not necessary to install it on hosts). It will at least by SSH hosts and collect information for you, according to your requests. It can also remotely control a bunch of scripted hosts.
For example, here on a local machine:
Oops, run here, because "Response text cannot be more than 10 thousand characters" - pastebin.com/hWsiwKxB
Or with filtering
[email protected]:~$ ansible all -m setup -u console --ask-sudo-pass -a 'filter=ansible_mounts'
SUDO password:
localhost | SUCCESS => {
"ansible_facts": {
"ansible_mounts": [
{
"device": "/dev/sda1",
"fstype": "ext4",
"mount": "/",
"options": "rw,errors=remount-ro",
"size_available": 286254039040,
"size_total": 310704988160,
"uuid": ""
}
]
},
"changed": false
}
[email protected]:~$ ansible all -m setup -u console --ask-sudo-pass -a 'filter=ansible_lsb'
SUDO password:
localhost | SUCCESS => {
"ansible_facts": {
"ansible_lsb": {
"codename": "trusty",
"description": "Ubuntu 14.04.4 LTS",
"id": "Ubuntu",
"major_release": "14",
"release": "14.04"
}
},
"changed": false
}
[email protected]:~$
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question