Sponsored Content
Top Forums Shell Programming and Scripting Need Help Writing Script To Email When Fax Queue Goes Down Post 302322341 by ITAdmin08 on Wednesday 3rd of June 2009 11:38:53 AM
Old 06-03-2009
Quote:
Originally Posted by TonyFullerMalv
Okat here goes:
Code:
#!/bin/sh
PATH=/usr/bin:/path/to/fax/commands
export PATH

FAXSTATUS=`vxfstat -a`
FAXTEST=`echo "${FAXSTATUS}" | grep "not running"`
if [ -n "${FAXTEST}" ]; then
  date > /tmp/mailfile
  echo "Fax not running." >> /tmp/mailfile
  echo "Status =" >> /tmp/mailfile
  echo ${FAXSTATUS} >> /tmp/mailfile
  fixfax
  sleep 3
  echo "Status after running fixfax =" >> /tmp/mailfile
  vxfstat -a >> /tmp/mailfile
  mailx -s "Fax has gone down" user@domain.com < /tmp/mailfile
fi

Replace /path/to/fax/commands with the path to vxfstat and fixfax.
Replace the email address with the one (or more with comma delimiters) that the message should go to.

Call this from cron at suitable regular intervals as the user that can get the status and run fixfax and it may be self healing as well as emailing that the fax queue went down.

looks like this will work. only problem is when fixfax is run it requires you to hit the enter key, is there a way to do that? Could I just leave out fixfax? I really just need it to notify me.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Fax Software

Do you know of any good and inexpensive Fax Software Package that can run on Unix and AIX? I will be using an external Modem attach to one of the system's serial port. I will be using it for sending faxes “only” Thanks for your help (1 Reply)
Discussion started by: falcon2460
1 Replies

2. UNIX for Advanced & Expert Users

Fax on Solaris

Hi all, I am running an application on Solaris 8. I want to send the output from this application as fax. To achive this i need to do add the fax as a printer on the unix machine. I want to know is : - What are the settings required to be done in order to make my server able to send fax... (0 Replies)
Discussion started by: zing
0 Replies

3. Solaris

fax hardware

hiho, do you know a hardware vendor which provide certified hardware for sun solaris/sparc with Class 2 or Class 1 compatible faxmodems pci-cards? i found many software for that purpose but no hardware... :( and the hcl on bigadmin only speaks about x86... thanks a lot greetings PRESSY (2 Replies)
Discussion started by: pressy
2 Replies

4. Shell Programming and Scripting

Fax Component

I would like to build a small fax component in Java or Perl. I have the javax.comm. (rxtx gnu.io) for Java for serial connection and get send a message to my fax were the light goes on and port is taken, but after that I am in the dark. Does anyone have some reference as to where I can get some... (1 Reply)
Discussion started by: photon
1 Replies

5. Shell Programming and Scripting

File queue script

Dear Gurus, I have an application that sends me thousands of small files. I need to write a script that sleeps for some time untile enough files have arrived then concatenate (n) files into 1 big file, then send that big file to a program to process it. For example, if I have the following... (2 Replies)
Discussion started by: GMMike
2 Replies

6. AIX

fax

aix5.3 - how do i test moden that just install/configure in aix5.3, and also how do i send fax ? (0 Replies)
Discussion started by: tjmannonline
0 Replies

7. UNIX for Advanced & Expert Users

Fax problem

Using the sendmail or other commands i need to send the attachment files for the Fax? Please provide the some example. (3 Replies)
Discussion started by: kingganesh04
3 Replies

8. UNIX for Dummies Questions & Answers

can we send fax to remote fax machine by lpr?

Hi all, Our application has to send Fax to our cutomer Fax number . I am using lpr -P faxser:test-fax <<dos format file>> I tested on our network Fax numbers . Its working fine. But when i try to send outside our network , its not sending all files are sitting in... (1 Reply)
Discussion started by: help_need
1 Replies

9. Shell Programming and Scripting

Detect if script starts from queue

Dear community, what I'm try to do is deny users to run a script without parameters from command bash, but the same script should run without parameters only from crontab. Example runs by crontab:*/5 * * * * /tmp/script.sh Here the normal execution starts every 5 minutes Example #1 runs by... (16 Replies)
Discussion started by: Lord Spectre
16 Replies

10. HP-UX

Sendmail FAX configuration

I've been trying to send FAXs from an HP_UX server using sendmail via an Esker FAX server. However if I try to include FAX configuration details in the receipient address it fails. See following string for general format... (1 Reply)
Discussion started by: JohnMair
1 Replies
FAXCRON(8)						      System Manager's Manual							FAXCRON(8)

NAME
faxcron - HylaFAX routine maintenance script SYNOPSIS
/usr/sbin/faxcron [ -n ] [ -l lastrun ] DESCRIPTION
faxcron is a command script that does routine upkeep tasks in a HylaFAX spooling directory hierarchy. This script is intended to be invoked from cron(8) on behalf of the fax user (often the ``fax'' user is uucp) once a day, with the standard output sent by mail to the HylaFAX administrator. For example, the following crontab might be set up for the fax user: 25 23 * * * sh /usr/sbin/faxcron | mail FaxMaster The faxcron script does the following work: o report statistics for facsimile transmitted since the last time faxcron was run. o report statistics for facsimile transmitted in the past week. o report statistics for facsimile received since the last time faxcron was run. o report statistics for facsimile received in the past week. o report any recent calls that failed suspiciously and return the associated trace log; o purge data that is 30 days or older from the remote machine information directory; o delete information that is 30 days or older from session trace log files; o remove files from the tmp directory that are older than 1 day; o remove files in the received facsimile queue that are 7 days or older; o report sites that are currently having jobs rejected; and o force all session log files to be owned by the fax user and kept with protection mode 644. OPTIONS
-n Forces faxcron to run without updating any files. -l lastrun Forces the notion of the last time that faxcron was run to be lastrun. The value of lastrun is a date and time string of the form ``MM/DD/YY HH:MM'' (the date(1) format string ``%D %H:%M''). -info n Set the expiration time for data in the info database to be n days. -log n Set the expiration time for session log data to be n days. -rcv n Set the expiration time for files in the received facsimile queue to be n days. -tmp n Set the expiration time for files in the tmp directory to be n days. -mode m Set the file protection mode for session logs to m (a command line argument to chmod(1)). NOTES
This script requires nawk(1) or gawk(1) and a date (1) program that supports the ``+format'' option. If session logs are to be kept private this script must be modified to filter out sensitive information such as calling card numbers. (It should also be run with ``-mode 0600'' so that session log files are not publicly readable.) FILES
/var/spool/hylafax spooling area /var/spool/hylafax/status/lastrun timestamp of last run /usr/sbin/xferfaxstats for generating transmit statistics /usr/sbin/recvstats for generating receive statistics /var/spool/hylafax/tmp/faxcronXXXX temporary file for truncating session logs /var/spool/hylafax/tmp/faxlogXXXX temporary file for logs of failed calls SEE ALSO
cron(8), faxq(8), faxgetty(8), faxsend(8), xferfaxstats(8), recvstats(8), hylafax-server(5) May 12, 1996 FAXCRON(8)
All times are GMT -4. The time now is 11:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy