Monday, June 24, 2013

facter - Puppet tool to get information about a system/host

facter, a Puppet library and a command-line tool (/usr/bin/facter), gives all the information  about a host in key,value format

1) Install facter in centos
 yum install facter

2) [root@dhcppc3 ~]# facter
architecture => x86_64
boardmanufacturer => Intel Corporation
boardproductname => D945GCNL
boardserialnumber => BTNL74300AAE
facterversion => 1.6.18
hardwareisa => x86_64
hardwaremodel => x86_64
hostname => dhcppc3
id => root
interfaces => bond0,eth0,eth1,lo,venet0
ipaddress => 192.168.1.33
ipaddress_bond0 => 192.168.1.33
ipaddress_lo => 127.0.0.1
is_virtual => false
kernel => Linux
kernelmajversion => 2.6
kernelrelease => 2.6.32-042stab076.5
kernelversion => 2.6.32
lsbdistcodename => Final
lsbdistdescription => CentOS release 6.4 (Final)
lsbdistid => CentOS
lsbdistrelease => 6.4
lsbmajdistrelease => 6
lsbrelease => :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
macaddress => 00:1C:C0:3E:4B:7E
macaddress_bond0 => 00:1C:C0:3E:4B:7E
macaddress_eth0 => 00:1C:C0:3E:4B:7E
macaddress_eth1 => 00:19:5B:6B:53:22
memoryfree => 2.37 GB
memorysize => 2.80 GB
memorytotal => 2.80 GB
mtu_bond0 => 1500
mtu_eth0 => 1500
mtu_eth1 => 1500
mtu_lo => 16436
mtu_venet0 => 1500
netmask => 255.255.255.0
netmask_bond0 => 255.255.255.0
netmask_lo => 255.0.0.0
network_bond0 => 192.168.1.0
network_lo => 127.0.0.0
operatingsystem => CentOS
operatingsystemrelease => 6.4
osfamily => RedHat
path => /usr/java/jdk1.7.0_09/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
physicalprocessorcount => 1
processor0 => Intel(R) Pentium(R) Dual  CPU  E2160  @ 1.80GHz
processor1 => Intel(R) Pentium(R) Dual  CPU  E2160  @ 1.80GHz
processorcount => 2
ps => ps -ef
rubysitedir => /usr/lib/ruby/site_ruby/1.8
rubyversion => 1.8.7
selinux => false
sshdsakey => AAAAB3NzaC1kc3MAAACBAKryNPR/FSsHtV0BQrt4kS9PEcYEzy/r8IrVcfPR2JjV4xUOLj8FPHlDGa0vaXeqnt6PF6uKq+v7jyvmTEeHPT8y+Zwd0ldBfWxlNWG/vy1m+nwejpeiWcpZLtZ0Pp4ix/xYqvhgVFk/lSD2VaI4oZDLNvzQUNJcIbUD+HXrLRqtAAAAFQDKCw61lmbXRJFJ1fBSsU6dN2CKNwAAAIBskr0Wy6z6axZhB3sHsONtPZB2lLRyr4IlwSLtsJrEPwbbLxMEYzsLP8hk7O9Bw+ms4vUn4Y/a//8TQ4l8opIqO61dlHPg7RD4+Eh/5Dq52Fs2eZtN7qj1JQUC3Gi8NKQ6FJR+wmndRFZfod4l0EFsrAIeBtOJqVj6u8U60XVQFQAAAIEAgRQQhRzQRGdtJjapID5Kyd9Gq8F1g8KeB0jBoGyEckKtSoZI4l+40nKA6AP6PZ2+AhMtuAHvQEF2QLrThEYuv30vPGmlZerFyBddE4tSo9RB/fCf7Lv2RLnnbAsHooiJRN0az55h10Ry0Belr5+21STGHZB4I2JRKOACzPbeMy4=
sshrsakey => AAAAB3NzaC1yc2EAAAABIwAAAQEAteAWPFoF++NYw0jbQ6dwJjpZrVZrgY85V+1hKDFn+Tjcq64ayDHXEbEhbOXo8PfDpk4S4Qbc+ZBsfdv+4kpAArCW0tCod2AFFDq8fLOtIKUmtF5yel1IjUoqoGqhxTW5JupxRznthtUbFI0/fvf96vVPvmL4bNTGB3Xizo9awc8Hxwf5DHZ+yTXHyLa9JFdKHhupQ127WXniooCke+XM036qN2pwMeCvRwZAKFwdrybP+J4g9jsmDeq2NJBOaFUSkg1zMqg0frjIGvyVNx451AtHeQ/6wXnFLASDQsuuoe4GrKenxtYF9v5YmNxQW5UJahe9HnkJC0gepIgoNH2iew==
swapfree => 4.88 GB
swapsize => 4.88 GB
timezone => IST
type => Unknown
uniqueid => a8c02101
uptime => 1:25 hours
uptime_days => 0
uptime_hours => 1
uptime_seconds => 5136
virtual => openvzhn

3) To get the value for a specific fact, say for example, the OS architechture,

# facter architecture
x86_64

No comments:

Post a Comment