Advertisement

09.15.2008 at 06:06AM PDT, ID: 23731770
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.1

AIX: obtain print queue's print server ip adres

Asked by dfke in Shell Scripting, IBM AIX Unix

Tags:

I have a system with 200+ print queues that appears not to be using DNS but /etc/hosts instead. Does anyone have a script to create a list of print queues with their corresponding print servers and ip adresses? The problem is that they're all remote HP queues which sets device = HP instead of device = printserver in /etc/qconfig. I need to resolve the corresponding backends that are listed in /etc/hosts. The queues are listed in /etc/qconfig with the following stanza:


queuename:
        device = HP
        up = TRUE
HP:
        backend = /usr/lib/lpd/pio/etc/piohpnpf -x printserver

The output should be something like:

queuename              printserver               printserver ipadress

I have the following script that resolves the device part but that obviously does not work when device = HP.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
for i in `lsallq`
do
    echo "Queue Name: " $i
    echo "----------------------------------------"
    for j in `lsallqdev -q $i`
    do
        echo "          Device Name:" $j
        hname=`echo $j | cut -f2 -d"@"`
        echo "          Hostname   :" $hname
        ip=`nslookup $hname 2>&1 | awk '/^Address/ {print $2}' | tail -n1`
        if ping -c 1 $ip > /dev/null 2>&1; then
            echo "          IP         :" $ip Ping ok.
            PINGABLE="$PINGABLE $hname[$ip]($i)"
        else
            echo "          IP         :" $ip No Ping.
            UNPINGABLE="$UNPINGABLE $hname[$ip]($i)"
        fi
        echo ""
    done
 
    echo ""
done
[+][-]09.15.2008 at 11:59PM PDT, ID: 22485549

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.16.2008 at 12:03AM PDT, ID: 22485577

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09.17.2008 at 09:17PM PDT, ID: 22507443

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Shell Scripting, IBM AIX Unix
Tags: AIX Print queue ip adresses
Sign Up Now!
Solution Provided By: mikelfritz
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20081119-EE-VQP-49 / EE_QW_EXPERT_20070906