Operating System - HP-UX
1752649 Members
5767 Online
108788 Solutions
New Discussion юеВ

Re: Trying to reach printers

 
SOLVED
Go to solution
Manuales
Super Advisor

Trying to reach printers

Hi ..
i need to verify if the printers are reachables or not.
i am using ping command.
I know that many of them are not reachables.. but i need to create the evidence.
when i ping them, it takes a long long long tiime ... who can i do to let the ping command know "if you can not reach the printer after 10 seconds, please break and follow the next one" ??? (i am using a shell using for ...)

what other command can i use to test if the printer is reachable or not?

please let me know.
thanks in advance.
Manuales :)
thanks in advance.

14 REPLIES 14
Patrick Wallek
Honored Contributor
Solution

Re: Trying to reach printers

Have you looked at the ping man page? You can limit the number of packets sent to each name/IP address. When that number of packets has been transmitted, the command will exit.

Consider the following:

# ping -n 3 printer1

will transmit 3 packets to printer 1 and exit.

# pint -n 5 -t 5 printer2

will time out after 5 seconds or 5 packets have been transmitted. The use of '-t' requires the use of '-n'.

See 'man ping' for more information.
Patrick Wallek
Honored Contributor

Re: Trying to reach printers

>># pint -n 5 -t 5 printer2
>>
>>will time out after 5 seconds or 5 packets
>>have been transmitted. The use of '-t'
>>requires the use of '-n'.

I screwed up above. The '-t' should actually be '-m'. The '-t' option is different.

The above should actually read:

# pint -n 5 -m 5 printer2

will time out after 5 seconds or 5 packets have been transmitted. The use of '-m' requires the use of '-n'.
Manuales
Super Advisor

Re: Trying to reach printers

pint ? ....

okok i am kidding .. you mean p├Г┬нng command ..ok ok let me try.

thanks for your support
Wilfred Chau_1
Respected Contributor

Re: Trying to reach printers

lpstat -p should show the status of the printer. i.e. online or offline.

ping is good.

you can also telnet to the printer port
(hp print server port : 9100 e.g.)

telnet 9100
you should then be presented with a menu and one of the item should show you the status of the printer.
Patrick Wallek
Honored Contributor

Re: Trying to reach printers

>>pint ? ....

>>okok i am kidding .. you mean p├Г ├В┬нng command
>>..ok ok let me try.

You are correct, I did mean ping.

Although a pint of an adult libation would be nice about now......
Manuales
Super Advisor

Re: Trying to reach printers

it is not working:

$ for a in `cat sidnsnoping.txt `
> do
> /etc/ping -n 2 -t 2 $a
> echo "==="
> done

output:
Usage: ping [-oprv] [-f address-family] [-i address] [-I interval] [-t ttl] hos
t [-n count [-m timeout]]
ping [-oprv] [-f address-family] [-i address] [-I interval] [-t ttl] hos
t packet-size [[-n] count [-m timeout]]

the file sidnsnoping.txt exists correctly ..

what is wrong here?
please help

Patrick Wallek
Honored Contributor

Re: Trying to reach printers

Use '-m' instead of '-t' as I said in my 2nd post.

ping -n 2 -m 2 $a
Matti_Kurkela
Honored Contributor

Re: Trying to reach printers

A simple "man ping" command would have enabled you to find the answer on your own...

ping -n 5 -m 2

will send 5 ping packets, and will wait up to 2 seconds for each ping reply. The total wait time should then be 10 seconds in the worst case (i.e. when the printer is completely not reachable).

If the printer is configured as a "remote" printer to HP-UX, it uses the traditional Unix LPR print protocol. In this case, you can use any tool that can connect to the TCP port 515 on the printer and verify that it works. This test can be done manually using the telnet command targeted to the port 515:

telnet 515 < /dev/null

If the printer is configured as a "network" printer to HP-UX, it is a printer equipped with a HP JetDirect adapter or equivalent functionality. In this case, the port number to test is usually 9100:

telnet 9100 < /dev/null

(The redirection of input from /dev/null prevents the telnet command from waiting forever for input if the test is successful and a connection is actually established.)

MK
MK
Manuales
Super Advisor

Re: Trying to reach printers

It is not working: :(


for a in `cat sidnsnoping.txt `
do
/etc/ping -n 2 -m 2 $a
echo "==="
done