1751854 Members
5879 Online
108782 Solutions
New Discussion юеВ

Re: Using f$getdvi

 
Steven_101
Advisor

Using f$getdvi

Working on script to daily look at device errors and send an email. Trying to figure how to do NIC's and PG devices.


Using TARGET_DISK = F$DEVICE("*","DISK") for idetifying disk drives, but system services $getdvi doesn't give a clue for nic's of pg devices
9 REPLIES 9
Jim_McKinney
Honored Contributor

Re: Using f$getdvi

Try "SCOM" and "BUS"... from DCDEF you might see

#define DC$_DISK 1 /* DISK */
#define DC$_TAPE 2 /* TAPES */
#define DC$_SCOM 32 /* SYNCHRONOUS COMMUNICATIONS DEVICES */
#define DC$_CARD 65 /* CARD READER */
#define DC$_TERM 66 /* TERMINAL */
#define DC$_LP 67 /* LINE PRINTER */
#define DC$_WORKSTATION 70 /* WORKSTATIONS */
#define DC$_REALTIME 96 /* REAL-TIME */
#define DC$_DECVOICE 97 /* DECVOICE products */
#define DC$_AUDIO 98 /* General audio */
#define DC$_VIDEO 99 /* General video */
#define DC$_BUS 128 /* BUSES, E.G, CI */
#define DC$_MAILBOX 160 /* MAILBOX */
#define DC$_REMCSL_STORAGE 170 /* REMOTE CONSOLE STORAGE */
#define DC$_MISC 200 /* MISCELLANEOUS DEVICES */
Jess Goodman
Esteemed Contributor

Re: Using f$getdvi

Use the following two loops:

$ DC$_SCOM = 32 !Synchronous Communications device class
$NIC_LOOP:
$ DEVICE = F$DEVICE("_%%%0:",DC$_SCOM)
$ IF (DEVICE .NES. "")
$ THEN
$ IF (DEVICE .EQS. "_RMA0:") THEN GOTO NIC_LOOP
$ ERRORS = F$GETDVI(DEVICE,"ERRCNT")
$ WRITE SYS$OUTPUT ERRORS," errors on ",DEVICE
$ GOTO NIC_LOOP
$ ENDIF
$!
$PG_LOOP:
$ DEVICE = F$DEVICE("_PG%0:")
$ IF (DEVICE .NES. "")
$ THEN
$ ERRORS = F$GETDVI(DEVICE,"ERRCNT")
$ WRITE SYS$OUTPUT ERRORS," errors on ",DEVICE
$ GOTO PG_LOOP
$ ENDIF
I have one, but it's personal.
Hoff
Honored Contributor

Re: Using f$getdvi

The DC device class and DT device type codes are massively limited in their capabilities, but they'll work for this case.

The skeleton of an idea for a brute force approach...

$ set noon
$ pipe show error > x.x
$loop:
$ wait 12:00:00
$ pipe show error > x.x
$ differences/output=nla0: x.x
$ if $status .nes. "%X006C8009"
$ then
$ mail x.x hoffman/subj="Error mail"
$ else
$ purge x.x
$ endif
$ goto loop

Another approach might look to use ANALYZE /ERROR /ELV TRANSLATE with a /SINCE=YESTERDAY selection criteria for DEVICE_ERRORS or CONTROL_ENTRIES or such. (The use of /ELV assumes a sufficiently recent version of OpenVMS.)

If you have a support contract for the hardware, some of the service tools have predictive capabilities.
John Gillings
Honored Contributor

Re: Using f$getdvi

Another approach would be to reset the error counts daily and mail the output of SHOW ERROR if it reports any errors. (since any reported errors must have occurred since the last reset).

For example

$ SHOW ERROR
$ IF $STATUS.EQS."%X10000001" THEN PIPE SHOW ERROR | MAIL/SUBJECT="Device errors" sys$pipe YOURSELF >nl: 2>nl:


Now you need to clear the error counts.

Here's a quick and nasty procedure that works by parsing the SHOW ERROR display:

$ IF p1.EQS.""
$ THEN
$ PIPE SHOW ERROR | @'F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))' SYS$PIPE
$ EXIT
$ ENDIF
$ OldPriv=F$SETPRV("PHY_IO,CMKRNL,DIAGNOSE")
$ OPEN/READ in 'p1'
$ SET NOON
$ ON CONTROL_Y THEN GOTO EndLoop
$ Loop: READ/END=EndLoop in line
$ dev=F$ELEMENT(0,":",line)
$ IF dev.NES.line THEN SET DEVICE/RESET=ERROR_COUNT 'dev'
$ GOTO Loop
$ EndLoop: CLOSE in
$ SET PROCESS/PRIVILEGE=('OldPriv')


A crucible of informative mistakes
RBrown_1
Trusted Contributor

Re: Using f$getdvi

Even easier than resetting the counts daily is to SHOW ERROR to a file and then compare to yesterday's file:

$ SHOW ERROR/OUTPUT=SHOWERROR.TXT
$ DIFFERENCES/OUTPUT SHOWERROR.TXT
$ IF $SEVERITY .EQ. 3 -
THEN MAIL /SUBJECT="Device errors" -
SHOWERROR.DIF SYSTEM

Set a version limit on SHOWERROR.TXT and SHOWERROR.DIF, and it cleans up itself.

Unfortunately, on a reboot you get a mail that shows the counts all went back to 0.
Wim Van den Wyngaert
Honored Contributor

Re: Using f$getdvi

... just delete the files at boot time.

I do a show error and if a counter increases I do an diag (or equiv with ca) and if I find "errors not to be ignored" I give an alarm.

Once a day seems too little for me. I look every 10 minutes.

Wim
Wim
Steven_101
Advisor

Re: Using f$getdvi

Jess, thats PERECT, its exactly what Im doing with the disks. It allows us to make it portable for any system. Basically it going to run detached, and 1st pass create a 'disk'.err file, and then I'll check that and compare.

Jim, I like that list, it give me the expanded ability to chekc other devices


thanks to all
Richard Brodie_1
Honored Contributor

Re: Using f$getdvi

I would also script looking at the network statistics from NCP or LANCP. You can have a completely non-functioning network, and it may not increment the device error count.
Jan van den Ende
Honored Contributor

Re: Using f$getdvi

Steven,

from your Forum Profile:


I have assigned points to 4 of 33 responses to my questions.

Some of the unassigned questions date back to 2005!

Maybe you can find some time to do some assigning?

http://forums1.itrc.hp.com/service/forums/helptips.do?#33

Mind, I do NOT say you necessarily need to give lots of points. It is fully up to _YOU_ to decide how many. If you consider an answer is not deserving any points, you can also assign 0 ( = zero ) points, and then that answer will no longer be counted as unassigned.
Consider, that every poster took at least the trouble of posting for you!

To easily find your streams with unassigned points, click your own name somewhere.
This will bring up your profile.
Near the bottom of that page, under the caption "My Question(s)" you will find "questions or topics with unassigned points " Clicking that will give all, and only, your questions that still have unassigned postings.

Thanks on behalf of your Forum colleagues.

PS. nothing personal in this. I try to post it to everyone with this kind of assignment ratio in this forum. If you have received a posting like this before please do not take offence none is intended!

PPS. Zero points for THIS entry, please.

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.