Printer availability


 
Thread Tools Search this Thread
Operating Systems Solaris Printer availability
# 1  
Old 03-27-2008
Bug Printer availability

Hi, Im new in shell programming.
I need to know the availability for specific printers. We send requests from solaris to printers located at an NT server. My idea is creating a shell that will monitor availbaility and send an email when something is wrong.
I have a file with printers and its corresponding NT server like this:
monitored_printers.txt
printer1 srvrnt01
printer2 srvrnt02

I want the shell looks for all possible issues that prevent the printer works.

For each row in monitored_printers.txt loop
1. Check network connection between solaris and NT with "ping srvrnt01" command
2. Check printer status with "lpc status printer1"

What else should I check to know if printer is working ok?
Im not a root user, is it possible for me to detect all causes? My job is just detecting issues with the printers, Im not able to fix them.
If someone in the forum has a shell for doing this would be great, thanks.
# 2  
Old 04-01-2008
There's no such script, you have to write it yourself. Depending on what is your requirement it could be very simple or a huge undertaking to write a script with cluster like HA features - A lot of work.

I can suggest you some ideas, the rest is up to you.

u will probably need to do a "while loop" with an inside "for loop"

monitor_printers.txt will be the list of all your printers and servers in the following

printer1
printer2
svrnt01
svrnt02

testprt.sh testnt.sh example are the different test scripts to test your printers/server alive.

/export/home/scripts an example of where on your unix box you might store your scripts.

~~~~~~~~~~~~~~ loopcheck.sh~~~~~~~~~~~~~~~

while true
do
for i in `cat /export/home/scripts/monitored_printers.txt`
do
/export/home/scripts/testprt.sh
/export/home/scripts/testnt.sh
done
sleep 300 # 5mins
done

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

chmod 755 /export/home/scripts/loopcheck.sh
nohup /export/home/scripts/loopcheck.sh &

The script will loop endlessly sleep 5mins wake up to run the "for loop" testing then sleep again.

the testprt.sh & testnt.sh script could include something like in the event cannot ping or cannot rectify then send email to your cellphone and you will be alerted.

read up unix man pages on test, if, while, for, mailx, lpstat


good luck
# 3  
Old 04-01-2008
Thanks for the info

It looks that the unix administrator will take this task, thanks!
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Solaris

High availability

hi guys I posted problem last time I didn't find answer to my issue. my problem is as below: I have two servers which work as an actif/standby in high availability system. but when i use command HASTAT -a i have the following message: couldn' find actif node. the servers are sun... (1 Reply)
Discussion started by: zineb06
1 Replies

2. Linux

Availability: echo vs. printf?

Hello, For some reason i dont remember, i currently believe (but beeing unsure) that printf is available on more diffrent systems (unix, bsd, linux, ??) than echo is. Could someone please enlighten me, whether this is true or not? Thank you PS: I just found pages about the diffrences of... (3 Replies)
Discussion started by: sea
3 Replies

3. Linux

Find printer location and printer type

Hi, Is it possible to find the printer location and printer type (whether it is local or network) using command in Linux ? Thanks in advance. (1 Reply)
Discussion started by: forumguest
1 Replies

4. AIX

Check printer queue on Windows printer server

Hello Let me first give a small overview of the setup. All printers are connected to Windows 2000 servers. There are a lot of UNIX (AIX & HP-UX) servers as well which have SAP running. I'm working on a script to add printers to a specified SAP instance. I want to verify the user input (to... (0 Replies)
Discussion started by: NielsV
0 Replies

5. Solaris

Configuring Printer with Printer Manager

Hi All, I am trying to configure printer in solaris 10 with the help of print manager. There is no printer attached to my system, ia m doing it for test purpose. However I am unable to do so coz its pops up window - Heading as error with option as dismiss and cancel. Kindly help as I am... (3 Replies)
Discussion started by: kumarmani
3 Replies

6. IP Networking

How do you send printer codes to an IP printer

We were printing to a serial laser printer with all the HP codes to generate a form (i.e. lines, boxes, etc.) Thus the file is filled w/ control codes. We are switching to an IP printer and we can no longer print directly to the device (i.e. cp text /dev/tty11). It looks like we have to use the lp... (2 Replies)
Discussion started by: jeffbugfree
2 Replies

7. Linux

know I do for to printer in printer deskjet 80colun

I want to print some thing in HP Deskjet 692.? (1 Reply)
Discussion started by: edvaldo
1 Replies
Login or Register to Ask a Question