<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script help - Vsifax in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564791#M29765</link>
    <description>Good call Joseph; it's my advanced one-finger typing technique again.&lt;BR /&gt;&lt;BR /&gt;Troy: One thing that I would suggest is that you get these scripts working perfectly from an interactive shell before you try them under cron. Cron's enviroment is very sparse so after you get them working as expected from an interactive shell you then only have to make sure that your have defined and exported PATH and any other variables.&lt;BR /&gt;&lt;BR /&gt;Clay</description>
    <pubDate>Mon, 13 Aug 2001 18:14:07 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2001-08-13T18:14:07Z</dc:date>
    <item>
      <title>Script help - Vsifax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564782#M29756</link>
      <description>Hello All,&lt;BR /&gt;&lt;BR /&gt;I need help writing a script. We have an application called VSIFax running on our system. It is a fax server. Well the server dies (software stops running, not the actual Unix server!). &lt;BR /&gt;&lt;BR /&gt;To check if the VSIFax software is running I type &lt;BR /&gt;#vfxstat -r&lt;BR /&gt;If it says the server is down I can re-start it by typing&lt;BR /&gt;#vfxsched start&lt;BR /&gt;&lt;BR /&gt;What or how do I write a script to periodically check if the &lt;BR /&gt;software is up, if not then to re-start it.&lt;BR /&gt;&lt;BR /&gt;I have a similar problem with a printer that for some reason gets disabled? I want to check to see if the printer is disabled, if so then to enable it.&lt;BR /&gt;&lt;BR /&gt;I know a script will accomplish this, and I can schedule the script in crontab. But I have barely any idea how to write the script (even though I bet it is easy).&lt;BR /&gt;&lt;BR /&gt;Any help would be appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Troy Hicks</description>
      <pubDate>Mon, 13 Aug 2001 15:26:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564782#M29756</guid>
      <dc:creator>Shar Hunter</dc:creator>
      <dc:date>2001-08-13T15:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Script help - Vsifax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564783#M29757</link>
      <description>Hi Troy:&lt;BR /&gt;&lt;BR /&gt;If I assume that the process running is called "VSIFax" then I could write something like this:&lt;BR /&gt;&lt;BR /&gt;if [ -z "`UNIX95= ps -C VSIFax|awk 'NR&amp;gt;1 {print $1}'`" ]&lt;BR /&gt;then&lt;BR /&gt;  echo "Fax process isn't running!"&lt;BR /&gt;else&lt;BR /&gt;  echo "Fax process is alive"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;For the printer you want to check, you could do something like:&lt;BR /&gt;&lt;BR /&gt;if [ `lpstat -p|awk '/myprinter/ {print $3}'` = disabled ]&lt;BR /&gt;then&lt;BR /&gt;  echo "printer is disabled"&lt;BR /&gt;else&lt;BR /&gt;  echo "printer is enabled"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 13 Aug 2001 15:57:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564783#M29757</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-08-13T15:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script help - Vsifax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564784#M29758</link>
      <description>I used to use vsifax on an IBM RS6000.  But I don't have my notes here (they're at home).  There is a log for vsifax that may give you the reason why vsifax is dying.  If it is due to a bad phone number, it should fail on the fax, but still keep vsifax RUNNING.  There is a vfxolog that tells you how the outbound faxes went, to include their failures.  I think there's a vfxilog too.&lt;BR /&gt;&lt;BR /&gt;On making a script to restart vsifax, I think it came with one (vfxstart.sh?).  There is an environmental file (under /etc) you need to source in your reset script.  (i.e.  &lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;.   /etc/vsifax.env&lt;BR /&gt;&lt;CODE goes="" here=""&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;There should be a spot where the inbound and outbound faxes are copied to.  Maybe this area is full?  &lt;BR /&gt;&lt;BR /&gt;Just some ideas.  &lt;BR /&gt;Steve&lt;/CODE&gt;</description>
      <pubDate>Mon, 13 Aug 2001 16:23:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564784#M29758</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2001-08-13T16:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Script help - Vsifax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564785#M29759</link>
      <description>Hi Troy,&lt;BR /&gt;&lt;BR /&gt;You are in luck. I happen to run vsifax. Your script should look very much like this&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;VSIFAX=/opt/vsifax3&lt;BR /&gt;PATH=${PATH}:/usr/bin:/usr/sbin:${VSIFAX}/bin&lt;BR /&gt;export VSIFAX PATH&lt;BR /&gt;&lt;BR /&gt;STAT=0&lt;BR /&gt;vfxstat -r | grep -q "is running"&lt;BR /&gt;VSTAT=$?&lt;BR /&gt;if [ ${VSTAT} -ne 0 ]&lt;BR /&gt;  then&lt;BR /&gt;      vfxsched start&lt;BR /&gt;      STAT=$?&lt;BR /&gt;  fi&lt;BR /&gt;exit ${STAT}&lt;BR /&gt;&lt;BR /&gt;That should do it, Clay</description>
      <pubDate>Mon, 13 Aug 2001 16:25:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564785#M29759</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-08-13T16:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Script help - Vsifax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564786#M29760</link>
      <description>I have not gotten any of this to work YET. James I used this script to test for the printer:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;if [`lpstat -p|awk '/lp17/ {print $3}'` = disabled ]&lt;BR /&gt;then&lt;BR /&gt;enable lp17&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;But when I run it I get this message:&lt;BR /&gt;(When the printer is already disabled)&lt;BR /&gt;/rd/bin/enablelp17[3]: [disabled:  not found.&lt;BR /&gt;When the printer is enabled already I get this:&lt;BR /&gt;/rd/bin/enablelp17[3]: [is:  not found.&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;For the vsifax server script I used the one from Clay. Here it is:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;VSIFAX=/opt/vsifax3&lt;BR /&gt;PATH=${PATH}:/usr/bin:/usr/sbin:${VSIFAX}/bin&lt;BR /&gt;export VSIFAX PATH&lt;BR /&gt;&lt;BR /&gt;STAT=0&lt;BR /&gt;vfxstat -r | grep -q "is running"&lt;BR /&gt;VSAT=$?&lt;BR /&gt;if [ ${VSTAT} -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;vfxsched start&lt;BR /&gt;STAT=$?&lt;BR /&gt;fi&lt;BR /&gt;exit ${STAT}&lt;BR /&gt;&lt;BR /&gt;When I run that script I get this result:&lt;BR /&gt;/rd/bin/vsifaxchecker[11]: test: Specify a parameter with this command. &lt;BR /&gt;&lt;BR /&gt;So I either have not entered them in correctly, or am not running the script right, or something. &lt;BR /&gt;&lt;BR /&gt;I need more help!&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Troy</description>
      <pubDate>Mon, 13 Aug 2001 17:30:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564786#M29760</guid>
      <dc:creator>Shar Hunter</dc:creator>
      <dc:date>2001-08-13T17:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script help - Vsifax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564787#M29761</link>
      <description>Hi Troy,&lt;BR /&gt;&lt;BR /&gt;In the case of the Vsifax script, the VSIFAX env var was set to my location; yours may be different.&lt;BR /&gt;&lt;BR /&gt;I think your other problem is related to the if syntax. There must be at least one space after the '[' and at least one space before the ']'.&lt;BR /&gt;&lt;BR /&gt;Hope this helps, Clay</description>
      <pubDate>Mon, 13 Aug 2001 17:39:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564787#M29761</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-08-13T17:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Script help - Vsifax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564788#M29762</link>
      <description>Your vsifax script problem is this:&lt;BR /&gt;&lt;BR /&gt;The error you recieved means your test failed due to unknown variable.&lt;BR /&gt;&lt;BR /&gt;The line above your test needs to be changed to VSTAT=$? verses VSAT=$?&lt;BR /&gt;&lt;BR /&gt;...jcd...</description>
      <pubDate>Mon, 13 Aug 2001 17:55:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564788#M29762</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-08-13T17:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Script help - Vsifax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564789#M29763</link>
      <description>In your printer script???&lt;BR /&gt;&lt;BR /&gt;I think you are grabbing the wrong variable.  Plus make sure your have your PATH setup correctly.&lt;BR /&gt;&lt;BR /&gt;I am fairly confident the it should be awk /lp17/{print $5}/&lt;BR /&gt;&lt;BR /&gt;...jcd...&lt;BR /&gt;&lt;BR /&gt;...jcd...</description>
      <pubDate>Mon, 13 Aug 2001 18:08:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564789#M29763</guid>
      <dc:creator>Joseph C. Denman</dc:creator>
      <dc:date>2001-08-13T18:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script help - Vsifax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564790#M29764</link>
      <description>Hi Troy:&lt;BR /&gt;&lt;BR /&gt;My apologies, this should be better:&lt;BR /&gt;&lt;BR /&gt;if [ "`lpstat -p|awk '$2=="myprinter" {print $3}'`" = disabled ]&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 13 Aug 2001 18:12:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564790#M29764</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-08-13T18:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Script help - Vsifax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564791#M29765</link>
      <description>Good call Joseph; it's my advanced one-finger typing technique again.&lt;BR /&gt;&lt;BR /&gt;Troy: One thing that I would suggest is that you get these scripts working perfectly from an interactive shell before you try them under cron. Cron's enviroment is very sparse so after you get them working as expected from an interactive shell you then only have to make sure that your have defined and exported PATH and any other variables.&lt;BR /&gt;&lt;BR /&gt;Clay</description>
      <pubDate>Mon, 13 Aug 2001 18:14:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564791#M29765</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-08-13T18:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Script help - Vsifax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564792#M29766</link>
      <description>10-4,&lt;BR /&gt;&lt;BR /&gt;Thanks for your responses, I will implement the suggestions right now.&lt;BR /&gt;&lt;BR /&gt;Troy&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Aug 2001 19:28:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564792#M29766</guid>
      <dc:creator>Shar Hunter</dc:creator>
      <dc:date>2001-08-13T19:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Script help - Vsifax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564793#M29767</link>
      <description>I made the changes to the path, as suggested. And used that correction to the printer script. Both are now working correctly, I tested them out. And I have them in place in crontab.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot.&lt;BR /&gt;&lt;BR /&gt;Troy</description>
      <pubDate>Mon, 13 Aug 2001 19:52:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564793#M29767</guid>
      <dc:creator>Shar Hunter</dc:creator>
      <dc:date>2001-08-13T19:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Script help - Vsifax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564794#M29768</link>
      <description>Hi James&lt;BR /&gt;&lt;BR /&gt;What UNIX95 and -C means in the cripts.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Nisar Ahmad</description>
      <pubDate>Tue, 14 Aug 2001 01:24:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564794#M29768</guid>
      <dc:creator>Nisar Ahmad</dc:creator>
      <dc:date>2001-08-14T01:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Script help - Vsifax</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564795#M29769</link>
      <description>The script attached is what I use.&lt;BR /&gt;&lt;BR /&gt;My fax device name is "fax1" you'll need to change it.  The script as written sends email to "watchdog" so change that too.  Also my install directory is /opt/vsifax3, change it to be appropriate for your install.&lt;BR /&gt;&lt;BR /&gt;It uses a couple of standard VSIFax utilities to try to determine if the server is up and status is good.  Hope this helps.&lt;BR /&gt;&lt;BR /&gt;I run it in root cron, every hour or so.&lt;BR /&gt;&lt;BR /&gt;Also see the VSIFax website about purging on a regular basis, otherwise file systems get full.&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Aug 2001 18:56:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-vsifax/m-p/2564795#M29769</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2001-08-14T18:56:51Z</dc:date>
    </item>
  </channel>
</rss>

