LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-27-2013, 06:15 AM   #1
sagar666
Member
 
Registered: Feb 2013
Posts: 212

Rep: Reputation: Disabled
To find os name


Hi,

I want to know the os wheather rhel or ubuntu or other.we are having more than 1000 machine.So i can't login and check every machine. Is it possible to check all machines os names using single command or any tool? If yes please let me know
 
Old 08-27-2013, 06:35 AM   #2
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 268

Rep: Reputation: 25
If you have console access to the machines, have them report the string from this command back:
Code:
 uname -a
However unless these computers have some service that allows you to access them over the network or something that reports the OS name on the network then it's going to be difficult. You could try using the nmap network scanner. It can fingerprint an operating system on the network and return the OS name in some cases. The computer must be powered on and be connected to a network.
 
Old 08-27-2013, 07:51 AM   #3
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
check out nmap:

http://nmap.org/book/man-os-detection.html

http://nmap.org/book/osdetect-usage.html

http://nmap.org/book/osdetect.html

or just google search using nmap for OS detection. then just wrist a script with either all of the domain names of the servers or their IPs and send all of the data you require to a log file.
 
Old 08-27-2013, 09:07 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by sagar666 View Post
Hi,

I want to know the os wheather rhel or ubuntu or other.we are having more than 1000 machine.So i can't login and check every machine. Is it possible to check all machines os names using single command or any tool? If yes please let me know
There are many options...nmap was mentioned, there's snmpwalk, fanout, etc.

However, if you're an administrator of more than 1000 machines, shouldn't you already have a monitoring solution in place, and easily be able to research this on your own? Don't you already HAVE scripts to help you in your job of maintaining over 1000 machines?
 
Old 08-28-2013, 08:17 AM   #5
dt64
Member
 
Registered: Sep 2012
Distribution: RHEL5/6, CentOS5/6
Posts: 218

Rep: Reputation: 38
Talking

Quote:
Originally Posted by displace View Post
If you have console access to the machines, have them report the string from this command back:
Code:
 uname -a
However unless these computers have some service that allows you to access them over the network or something that reports the OS name on the network then it's going to be difficult. You could try using the nmap network scanner. It can fingerprint an operating system on the network and return the OS name in some cases. The computer must be powered on and be connected to a network.
uname provides kernel info, not the "OS" you are running.
On RedHat-like systems try
Code:
 cat /etc/*release*
If you can't find an automatic network OS-identification tool and you can't find the time to do every single machine your own, just employ a few students for a few hours doing it all manually for a few bucks. Might even be cheaper than hiring an experienced consultant writing a script for you or stumping your nose on the existing function in your existing monitoring system.
 
1 members found this post helpful.
Old 08-30-2013, 03:15 AM   #6
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 268

Rep: Reputation: 25
Quote:
Originally Posted by dt64 View Post
uname provides kernel info, not the "OS" you are running.
Sorry, I thought it also shows the distro name. I get this on my system:
Quote:
Linux homepc 3.2.0-4-486 #1 Debian 3.2.46-1 i686 GNU/Linux
 
Old 08-30-2013, 05:15 AM   #7
dt64
Member
 
Registered: Sep 2012
Distribution: RHEL5/6, CentOS5/6
Posts: 218

Rep: Reputation: 38
On one of my TestVMs I get
Code:
[root@CentOS6 ~]# uname -a
Linux CentOS6 2.6.32-358.14.1.el6.x86_64 #1 SMP Tue Jul 16 23:51:20 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Yes, it includes the distro name. But no distro version information. If it e.g. was a CentOS5 it could have been an earlier or later version. The differences between early and latest CentOS5 versions are quite noticable.
But it gives you a first idea, yes.

Code:
[root@CentOS6 ~]# cat /etc/*release*
CentOS release 6.4 (Final)
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
cat: /etc/lsb-release.d: Is a directory
CentOS release 6.4 (Final)
CentOS release 6.4 (Final)
cpe:/o:centos:linux:6:GA
Here you have distro name and release version.

In your example it states Debian. From top of my head I wouldn't know which Debian release includes kernel 3.2.x (assuming the system runs the originally distro-included kernel version), but if it statet Woody or Wheezy I'd had a better idea of what it is. (ok, kernel 3.2.x wouldn't be in Woody)
 
Old 08-30-2013, 04:46 PM   #8
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
well to kind of backup dt64 on uname not "really" providing distro info look at the Fedora uname, it tells you its f19, but only if you know what to look for and does not give any further info:

Code:
$ uname -a
Linux tracy.ssmahome 3.10.9-200.fc19.x86_64 #1 SMP Wed Aug 21 19:27:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Li
now in the Fedora world you also have /etc/release its /etc/issue:

Code:
$ cat /etc/issue
Fedora release 19 (Schrödinger’s Cat)
Kernel \r on an \m (\l)
still not a great lot of info, but it is what it is.

Code:
$ cat /etc/*release*
Fedora release 19 (Schrödinger’s Cat)
cat: /etc/lsb-release.d: Is a directory
NAME=Fedora
VERSION="19 (Schrödinger’s Cat)"
ID=fedora
VERSION_ID=19
PRETTY_NAME="Fedora 19 (Schrödinger’s Cat)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:19"
Fedora release 19 (Schrödinger’s Cat)
Fedora release 19 (Schrödinger’s Cat)
cpe:/o:fedoraproject:fedora:19
provides the most amount of data. sadly this is not something you are going to run via a WAN/LAN without logging into a system, as ssh foo@server "bar" is still logging into a remote system even though it does not stay logged in.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Find URL in Debian package index via awk/sed (=find a line, then search from there) maddes.b Linux - Software 11 06-28-2013 07:37 AM
find hidden files from wild card path using 'find' nagendrar Linux - Newbie 5 10-13-2011 10:48 PM
[GNU find version 4.2.27] find: paths must precede expression mechagojira Linux - Newbie 3 07-06-2011 05:34 AM
Find with -exec argument - not giving proper output..how to find... hinetvenkat Linux - Server 4 01-25-2010 06:19 AM
Find/grep/wc command to find matching files, print filename and word count dbasch Linux - Newbie 10 09-14-2009 05:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration