| Front Page | News Headlines | Technical Headlines | Planning Features | Advanced Search |
ROC Software Sponsor Message

     

Setting off alarms

By Steve Hammond

Inside VESOFT covers tips and techniques you can use with VESOFT’s products, especially MPEX.

I love this time of year around here. To be more specific — “this time of year” is early October and “here” is the Middle Atlantic states. That combination generally means a cool bite in the air, fresh apples and apple cider, Mother Nature changing the trees from green to various shades of earth tones and post-season baseball.

Some of my strongest childhood memories revolve around October baseball — running home to try to catch the last few innings of that day’s World Series game or the lengths the boys in my class went to smuggle a transistor radio into the class room to listen to the game. I remember my brother (seven years older, and a die-hard Yankee fan with an anger management problem) beating me up because he was so mad when Pittsburgh’s Bill Mazerowski hit the ninth inning home run to beat the Yankees in 1960. I remember worrying that it might happen again in 1962 until Bobby Richardson caught the Giants’ Willie McCovey’s line drive to save the Yankees (and me).

Then came the aberration of night World Series games and now young boys don’t have that opportunity for the self-satisfaction one gets by sneaking that radio into the classroom and listening. It was sort of a rite of passage.

But there is an opportunity for some stealth these days, since the first round of the baseball playoffs features afternoon games. And with advances like Real Player, I could plug my headphones into my speakers and catch a game. There was only one problem, the 50+ year-old synapses are not as good at remembering what time something would start as they were when they were still in Miss Shears class at Eisenhower Elementary School. Plus there are the distractions of work, family, co-workers (whereas as a youth, nothing distracted from baseball). And believe it or not, that’s where MPEX came in very handy. (Didn’t see that one coming, did you?)

MPEX gives us the ALARM command along with its companions SHOWALARM and DELETEALARM. ALARM let’s you use any number of variables to trigger an alarm. In this case, it’s fairly simple:

%ALARM “1:00PM”, Time for the game Steve;session

The WARNF command puts messages where the function keys usually reside on screen

All this says is the next time 1PM rolls around, send a message to me that it’s time for the game. This will only happen one time and then go away. The ‘;session’ tells MPEX to send the message to the session that made the command.

One of the beauties of the command is that the message does not come up in the text part of the screen, where it could get lost among scrolling text. Using the MPEX WARNF command, the message actually clears out the function keys display at the bottom of the screen and places the message there (see the figure). That message stays there until the return key is struck. If you know the message will be going to a Non-HP terminal, then tack “;NOHP” onto the end of the command and it will send out the message as if it were a “TELL” command.

Even more helpful is that the command is not merely time-driven. You can use many other variables to trigger an alarm. What if I can’t wait to tell my friend Rod that joke I heard this morning?

%ALARM ‘JSCOUNT(“ROD,@.@”)>0’, Rod has just signed on;CHECKEVERY=1

This looks for any job/session that uses the session name “ROD”, it sends out the message to me (the command default) and it checks it every minute (see illustration). If you know a job is running and you want to be informed when it stops, try ‘JSCOUNT(“COMPILE,JOBS.DEV”)=0’. That asks MPEX to check every minute until the COMPILE job is no longer out there.

The figure also shows the SHOWALARM command, which displays all the pending alarms with the parameters you set to send the alarm and the message. If you want to get rid of a pending alarm, do the SHOWALARM command, note the alarm number and do:

%DELETEALARM n (where ‘n’ is the alarm number)

The other options to the command include the aforementioned CHECKEVERY, which instructs MPEX to check for the condition every specified number of minutes (or really ‘cycles’ — see below) and REPEAT, which lets you repeat the alarm on the list of specific days, DAILY or WEEKDAYS. For example, let’s say you need to be reminded of a daily 10:30am meeting:

%ALARM “10:25AM”, “Go to Tim’s Meeting”;REPEAT=WEEKDAYS

If you work seven days a week and there’s this meeting every day, you could have done REPEAT=DAILY and if the meeting is only Tuesday and Thursday, then you would use REPEAT=TUESDAY, THURSDAY.

You might also note in the last example, I put the message within quotes. That’s because I needed to use a quote in the message. If you have to use a quote, comma or parentheses, then you need to enclose the message within quotes, making sure to not match the ‘enclosing’ quotes within the command. For example, if you did %ALARM “10:25AM”, ‘Go to Tim’s Meeting MPEX would consider the message to be “Go to Tim” and remaining “s Meeting’” would produce an error.

Who receives the message (or where the message is sent) can also be set in the command. As I noted earlier, the default is to send the alarm to the session that issued the command or you can do the same with the ;SESSION option. Other options are ;LOGON, meaning the exact logon — session name, user name and account — and ;TERMINAL, meaning the terminal that was used when the command was issued. The bigger picture here is the ;TO= option, that lets you define specific users or devices:

%ALARM ‘JSCOUNT(“JJ1155,@.@”)>0’, The hacker is back; TO=LDEV=20; CHECKEVERY=15

Let’s say you have a hacker who always comes in using the session name JJ1155. You want someone to know as soon as he logs in. This will look for that session and will send a message to the console (LDEV 20). If you want to remind the development staff of a meeting, try:

%ALARM , Development Staff meeting now;TO=@.DEV

This will send a one-time message to everyone logged on to the DEV account. Note the lack of a time or a boolean expression — the message is sent immediately and goes to a specific set of users, similar to the WARNF command.

Of course for any of this to work, you need to be running MPEX’s BACKG job, which controls all of the background activity. By default, BACKG wakes up ALARM every minute and has it check for any of the conditions set for alarms. If you want to have it check more often, then you need to tweak it a little. If you can change the line in the file BACKGINI.DATA.VESOFT so that it reads:

SETVAR VESOFTALARMPAUSE 15 — default is 60

This tells BACKG to wake up and check every 15 seconds, instead of 60. Note that the option CHECKEVERY=2 does not mean wake up every two minutes, it means wake up every two cycles or iterations. So if you have set the pause to 15, a cycle or iteration is 15 seconds and therefore CHECKEVERY=2 will wake up every two cycles or 30 seconds. Be aware that any alarm that is base on a boolean expression will use system resources, so use them wisely.

This command did lead to at least one perk — when we had the staff pizza party, I would be called to send out the message that the pizza had arrived. I often took that opportunity to head down to the lounge to grab a couple slices of pepperoni and sausage while it was still hot before I sent out the ALARM — hey, you gotta take your opportunities when they arise!

Steve Hammond, who works for a trade association in Washington, DC, went to Game Seven of the 1979 World Series.


Copyright The 3000 NewsWire. All rights reserved.