Reputation: 587
In powerShell I can get some info about other system, for example with:
Get-WmiObject Win32_OperatingSystem -computer computerName
I know in with Linux I can do something like:
ssh computerName uptime
but this way I have to type a password. Can it be done with no pass needed? Interesting in info like disk and memory also, maybe all run in a script. Thank you
Upvotes: 0
Views: 3111
Reputation: 3609
As others have pointed out, you can ssh into a remote system without having to type a password every time by using ssh keys (google for "putty ssh keys" to find a lot of tutorials).
However, if your intent is to monitor a remote system, I think you're asking the wrong question. If you want to know the uptime, load, and other useful stats about a UNIX machine there are a couple of choices:
The former (SNMP) is a simple protocol (as the name suggests) used to monitor network devices, printers, UPS systems, and the like. I bet even your home router supports SNMP queries. A SNMP monitoring tool just sends queries over the network and parses the data it receives.
The latter (Nagios) is a framework with monitoring capabilities for various aspects of remote servers such as disk load, application status, performance, and so on. It can use SNMP and overall does quite complex tasks such as making sure a web server is still responding to a specific request, that a SMTP server is working, that a network share is not full, etc. It's a bit cumbersome to set up the first time but if you have a large infrastructure it's a must.
Upvotes: 1
Reputation: 1632
You may use ssh with registered rsa keys insted of password, this allow ssh commands from scripts. Follow this tutorial.
Once configured, all bash commands are accessible with:
ssh root@remoteHost "commands"
It's also a must to use vnc to query your server, allowing u to use graphic apps with very few payload (xauth and twm are enough)
Upvotes: 2
Reputation: 18952
You could use Hping.
It's a command-line oriented TCP/IP packet assembler/analyzer (the interface is inspired to ping).
The --tcp-timestamp
switch will "guess" the uptime (details in Phrack Volume 0x0b, Issue 0x3f, Phile #0x01 of 0x14).
hping3 --tcp-timestamp -S ip.remote.host -p 80
TCP timestamp is not the only method of getting knowledge about uptime of remote server. You can find some more ideas/tools in Why uptime can be dangerous.
Upvotes: 0