1819951 Members
3369 Online
109607 Solutions
New Discussion юеВ

nis clients in a domain

 
steven Burgess_2
Honored Contributor

nis clients in a domain

Hi all

Quick 10 points. Whats the easiest way to check the number of and hostnames of clients in a NIS domain ?

Thanks in advance

Ste
take your time and think things through
13 REPLIES 13
George_Dodds
Honored Contributor

Re: nis clients in a domain

Hi Steve nice to see that you've got a proper job at last ;)

Isnt it just one of the yp commands maybe ypcat hosts.

Ta

George

S.K. Chan
Honored Contributor

Re: nis clients in a domain

Do a ..
# man rpcinfo
and what you can do is run ..
# rpcinfo -b ypbind 1 | more
==> That should list all machines that has ypbind running. Just run it again and pipe it to "wc -l" to get the total. Just keep in mind ypbind is also run on the master and slaves. To get just those you would ..
# rpcinfo -b ypserv 1 | more
or simply ..
# ypcat -k ypservers
Uday_S_Ankolekar
Honored Contributor

Re: nis clients in a domain

ypcat... is the command.

use ypcat -k ypservers.

Ours is not a NIS setup, but I am sure it's a ypcat command

-USA..
Good Luck..
George_Dodds
Honored Contributor

Re: nis clients in a domain

Bill Douglass
Esteemed Contributor

Re: nis clients in a domain

rpcinfo -b ypbind 1

will return info for hosts on your local subnet. You would need to repeat this for each subnet that is served by your NIS domain.

Check the output from ypcat -k hosts.byname. Presumably, if you are sharing a hosts file by NIS, it will be updated to include the local client names as well as key servers in your domain.
steven Burgess_2
Honored Contributor

Re: nis clients in a domain

Hi

Thanks for the replies

ypcat -k ypservers - I had looked at this but it gives me the master and slave

S.K you have given me the number of hosts , thanks

Still not got the names of the hosts in the domain

Ste
take your time and think things through
Andreas Kruth
Occasional Advisor

Re: nis clients in a domain

Hi,

from the O'Reilly book:
"NFS and NIS"

#! /usr/bin/ksh

( for host in $(ypcat hosts | awk '{print $2}')
do
ypwhich $host
done ) | grep -v 'not-bound' | sort | uniq -c
#EOF

Output:


Maybe helpful

Regards,
Andreas
S.K. Chan
Honored Contributor

Re: nis clients in a domain

Mmm..
# rpcinfo -b ypbind 1 | more
should give you the IP address in the first column(field) and follow by the hostname in the 2nd column (field).
steven Burgess_2
Honored Contributor

Re: nis clients in a domain

Hi

We are using dns for resolution

had checked hosts.byname

Thanks

Ste
take your time and think things through
Shannon Petry
Honored Contributor

Re: nis clients in a domain

As far as I know, you wont be able to do this.

ypcat -k ypservers

Only shows you the NIS Database of listed servers.

ypcat hosts

Only shows the NIS map of /etc/hosts from the master server.

rpcinfo will not show you much, because the way NIS works, it is not bound and constantly chatting like winblows. Only when clients need data is there network activity.

So, Im not sure that you can easily do what you want. When I go to a new site, I will usually nmap the whole site, then start telnetting to see how things are configured one at a time.

Regards,
Shannon
Microsoft. When do you want a virus today?
steven Burgess_2
Honored Contributor

Re: nis clients in a domain

Thanks everyone

I'm off home now. Will respond tomorrow after man utd have beat madrid 3 - 0 (fingers crossed)

Steve
take your time and think things through
S.K. Chan
Honored Contributor

Re: nis clients in a domain

On a host that does not run NIS (ie ypbind not running) the ypbind service does not show up in "rpcinfo -p". If you stop nis.client..
# /sbin/init.d/nis.client stop
and run ..
# rpcinfo -p
the ypbind srvice does not show. Start nis.client again and it appears.
Shannon Petry
Honored Contributor

Re: nis clients in a domain

Your still forced to do this on each client. The rpcinfo method is just as easy as 'ypwhich'. It really makes no difference.

The main problem with achieving the desired results is the way NIS works. Clients are not on "bound" connections.

Historically, this was done for performance. Lord knows we see how slow windblows is with locking connections, and Novell is not much better (used to be worse).

Regards,
Shannon
Microsoft. When do you want a virus today?