Archive

Archive for November, 2009

Change default remote printer timeout in AIX

November 24, 2009 Leave a comment

Recently we have been having problems with a certain older Printronix printer going down every few days. The AIX print queue would show it down. This would happen after the users replaced the paper.  Even then it would only be when it took a long time to replace paper.

In AIX the default rembak period is 90 seconds. Rembak is the command that actually sends jobs to a remote server (Printer). This can include a print job, status request, cancel job request, or request to kill the queuing. When this particular printer is opened to replace paper it will not answer any requests. Its quite easy to see how the users went past 90 seconds and caused the queue to go down.

One option I found to change the default time out was to add –T60 (60 minutes) behind the piorlfb entry for the printer in /etc/qconfig. Someone had in fact done this in the past and it did not fix the issue. The reason it did not fix the issue is because this flag is ignored if local filtering is done.

The actual fix was to edit the following read-only file:

/usr/lib/lpd/pio/etc/piorlfb

Change to following line:

 typeset         piorlfb_rbflags=””              # rembak flags

to

typeset         piorlfb_rbflags=”-T1200″                # rembak flags

Change -T1200 to whatever you wish. This is in seconds. So in this case I chose 20 minutes.  If there is no –T setting it will default to 90 seconds.

Advertisements
Categories: AIX, UNIX

Use MUTT to send email attachments and specify from address

November 12, 2009 2 comments

Recently I had to change the outgoing email program used on my AIX boxes. Previously mailx was used along with uuencode. This had become a problem due to some webmail sites and mail clients being unable to decipher uuencoded attachments. To overcome this I installed MUTT from the AIX Toolbox for LINUX Applications cd.  MUTT will send the attachments using MIME.

 The requirements from the programmers that determined which switches I used were as follows:

  • Have to be able to script the command.
  • Ability to set the ‘from’ and ‘to’ email address fields
  • Ability to set the subject
  • Ability to attach pdf documents
  • Ability to put a standard text file into the email body

Here is the command I used:

 mutt -e ‘set from=fromaddress@test.com’ -s ‘subject’ -a file.pdf toaddress@test.com < body.txt

 Explanation of options:

 mutt : The mail client being used to send the email.

 -e : Specify a command, this must be in quotes, in this case we are setting the from email address variable to fromaddress@test.com

 -s : subject of the email, must be in quotes if there will be spaces or special characters

 -a : attachment, specify the file to be attached in mime format. In this case a pdf file in the current working directory, can be a full path.

 The to email address must be specified at the end of the command with no switch options. In this case I am sending the email to toaddress@test.com

 < : Put the contents of a file into the message body. This can be a file that has something standard we want in all emails. Could also use echo to put something in on the fly, or use /dev/null to have a blank body. There HAS to be something redirected to the body or it will not send.

 

Categories: UNIX