The VdAstrid2 device
Status:
This documentation applies to version 1.40.1737.52 (2/9-2019) of the VdAstrid2 device.
Contents:
- Overview
- CVdCalcAstrid2
- Facility Health (CVdFacilityHealth)
- Local Environment Health (CVdLocalEnvHealth)
Overview
The vdAstrid2 library contain ConSys devices specific for ASTRID2 and ASTRID2 beamlines.
CVdCalcAstrid2
Device for calculations related to ASTRID2.
Facility Health (CVdFacilityHealth)
The CVdFacilityHealth monitors the status of the facility environment. This includes monitoring of the connection and synchronization state of all ConSys SQL databases at ISA and monitoring of the connection to and synchronization of ConSys related network folders.
Cluster name: FacilityCmmnHealth
Description: Facility Health Common
Common cluster for overall status and control og the facility health device.
parameter |
surname |
Data Type |
Mode |
Comment |
0 |
enableSend | boolean | W | Enable send message to SMS/Mail device. Messages will only be send to SMS device if this bit is enabled. |
5 |
smsDisabledTimeLeft | word | W | 0: Message enabled, >0: Time left (in minutes) of disabled log to SMS/email - will auto enable when time runs out. If time > 10000, does not count down. |
1 |
lastMsg | string | R | Last error/log message. |
2 |
lstMsgTime | time | R | Last message time. |
SQL database monitoring
The connection to the individual SQL databases are tested every minute using SQL security for the connection. To test the synchronization an increasing sync check number is written to the 'SyncCheck' table on isasvr07 as part of the connection check to the server. On all other SQL servers, the sync check number is read from the SQL database as part of the connection check. If the sync check number differs by more than the tolerated difference (2), a synchronization error is indicated by the status bits and reported to the SMS/Mail device if the conditions for this are fulfilled - see comments for FacilityDbHealth.cntBeforeFail, FacilityCmmnHealth.enableSend and FacilityCmmnHealth.smsDisabledTimeLeft. Trusted connection test on each subnet are tested by CvdLocalEnvHealth devices running on ConSys frontends of the different networks/domains. The status of all CvdLocalEnvHealth instances are collected in CvdFacilityHealth to give and overall status of the SQL trusted connections.
Device setup, SQL database monitoring
In order for the device to work ODBC must be set up for all SQL servers on the frontend PC running the health device. The ODBC must set up to use SQL security with ODBC names like:
ConSysSQLSec ISASVRxx
where xx is 06,07,08,10,11,13,14,15,16
Cluster name: FacilityDbHealth
Description: Facility DatabaseHealth
This cluster contain all status and control for the database status check.
parameter |
surname |
Data Type |
Mode |
Comment |
8 |
dbAllOk | word | R | All database connections and syncronisation is ok. |
9..16 |
dbConSvrXX | boolean | R | SQL security connection to ISASVRXX server is ok. |
17..24 |
dbVersXX | word | R | Database version read from the database. |
25..32 |
dbChckXX | word | R | Synchronization check number read from database. |
33..40 |
dbSyncSvXX | boolean | R | Synchronization check ok - synchronization check number corresponds to check number set from SQL server source. |
41 |
cntBeforeFail | boolean | W | Number of database checks before sending a message in case of state change (1 check/minute) - start value. Used to avoid sending several messages if more than one fail within this period - or the fail is recovered by itself within this period (caused by common cause, ex. network problems,or computer restarts). |
42 |
cntLeftBeforeLog | word | R | Number of database checks left before sending a state change message. |
43 |
dbTrustOk | boolean | R | All trusted database connections and syncronisation is ok (obtained from local health devices). |
44 |
dbVersionIdentical | boolean | R | All Database versions read from SQL databases are identical - ie. synchronization of database version between databases completed - ok to signal db update. |
53 |
dbMsg | string | R | Last SQL message. Same string is set to device 'lastMsg'. This message is not cleared - or overwritten by other parts of the health device. |
Folder synchronization checks
CvdFacilityHealth can check folder replication/synchronization. The checks are implemented as a general synchronization check where sync state of a test file generated in a source folder is checked in a number of synchronization destination folders. For each replication source the device creates a directory ’ReplCheck’ in the root specified by the ’sourceFolder’ attribute. At periods specified by ’writePeriod’ a source file ’ ReplicationCheckFile_X.txt’ is written to the source folder. This file is a text file that includes an increasing check number and a timestamp representing the creation time of the check file. The device supports up to 20 source folders each identified by an integer from 0..19. For each source folder a number of destinations folders can be defined. The destination check folder must set a reference the corresponding source folder given by the source index. At intervals defined by the destination folder ’readPeriod’ the destination file is read from the destination folder and checked against the timestamp of the last written source file. If the time difference between the read destination timestamp and the current source timestamp exceeds the destination ’maxDiffTime’ the replication status set in ’replStatus’ goes to fail. If ’alarmMsg’ is enabled for the destination, an alarm message is set to the device status – and send as SMS, if the device ’enableSend’ is checked.
Replication heakth common cluster - 'FacilityFileReplCmmn':
parameter |
surname |
Data Type |
Mode |
Comment |
48 |
forcedStatusUpdate | boolean | W | Forced replication update - read and check all replication destination test files, update status flags. |
49 |
clearLatchedStatus | boolean | W | Clear all replication latched errors. |
50 |
overallStatus | boolean | R | Status of all enabled replication status - TRUE if all enabled replications is ok. |
51 |
latchedOverallStatus | boolean | R | Status of all enabled replication status latched - TRUE if all enabled replications is ok. |
52 |
replEnable | boolean | W | Overall enable/disable of file replication /synchronisation checks. |
54 |
replMsg | string | R | Last replication message. Same string is set to device 'lastMsg'. This message is not cleared - or overwritten by other parts of the health device. |
Source folders:
Source folders use 2-dimensional addressing. The device supports up to 20 source folders. The service/user running the device must have write access to the source folder.
a0: Source folder index (0..19)a1: Parameter index:
parameter |
surname |
Data Type |
Mode |
Comment |
0 |
sourceFolder | string | W | The full path to the replication source folder. |
1 |
writePeriod | word | W | The source file write period in minuttes. Must be in the same order as the replication period of the dependend destinations. |
2 |
writeSource | boolean | W | Enable source write for this folder. All destination checks depedend on this source will be disabled if the source write is disabled. |
3 |
writeChkNumber | word | R | Current replication check number (Written to the newest source file). |
4 |
DependReplStatus | boolean | R | Overall status of all replications dependend on this source. |
5 |
fileWrite | boolean | R | Status of last try to write the source check file. TRUE if the check file was written ok. |
Destination folders:
Destination folders use 2-dimensional addressing. The device supports up to 100 destination folders. The service/user running the device must have read access to the destination folders.
a0: 'Destination folder index (0..99)' + 100a1: Parameter index:
parameter |
surname |
Data Type |
Mode |
Comment |
0 |
destFolder | string | W | The full path to the destination replication/sync folder. |
1 |
readPeriod | word | W | read check period i minutes - the file is read and checked with this period. Should be less than or equal to replication period of the destination folder. |
2 |
sourceIndex | word | W | Index to the replication source (0..19). Must point to the source cluster with which the destination folder is syncronized. |
3 |
checkDest | boolean | W | Enable replication check for this destination folder. |
4 |
checkNumber | word | R | Read check number. |
5 |
diffTime | word | R | Time difference in minutes between the timestamp read from the destination file and the last written timestamp to the source file in pointed to by 'sourceIndex'. |
6 |
replStatus | boolean | R | status bit, TRUE if replication check ok. |
7 |
alarmMsg | boolean | W | Include in alarm message if fail - if this bit is set, a message will be added to the devices status in case of failure. An SMS is send if the device has sendMessage enabled. |
8 |
maxDiffTime | word | W | Maximum time differnce in minutes between source write timestamp and replicated/synchronised/backed up check file timestamp. This time must be set higher than the synchonisation period of the folders.. |
9 |
latchedReplStatus | boolean | R | Latched status, if once in error stays in error until common clear is set. |
10 |
checkReady | boolean | R | The device do not start checking before initial check file written has had time to be replicated to the destination, FALSE until check is started. |
11 |
statusRaw | boolean | R | The status without considering the ready check. Could be wrong until ready is ok if the sync test has been of for to long. |
12 |
fileOpen | boolean | R | Status of last try to open destination check file. TRUE if the check file opened ok. |
Local Environment Health (CVdLocalEnvHealth)
The CVdLocalEnvHealth is used to monitor the status of the local environment in context of Windows domain and network connection. In the initial version the device monitors the connection state of both trusted ConSys SQL databases in actual domain/network the device is running in. The following instances of the device is running to cover all current combinations of network/Windows domain:
ISA domain, ISA Lab Net, HealthDbISA_ISA: Device id: 3701, FEC13, I1 UNI domain, ISA Lab Net, HealthDbUNI_ISA: Device id: 3702, ISAUNI02, I0 ISA domain, IFA Lab Net, HealthDbISA_IFA: Device id: 3703, FEC15, I0 UNI domain, IFA Lab Net, HealthDbUNI_IFA: Device id: 3704, ISAUNI01, I0 ISA domain, ST-Client, HealthDbISA_STCLIENT: Device id: 3705, ISATEST03, I0 UNI domain, ST-Client, HealthDbISA_STCLIENT: Device id: 3706, ISAUNI03, I0
Cluster names: HealthDbXXX_YYY
Description: Health Database domain XXX on network YYY
parameter |
surname |
Data Type |
Mode |
Comment |
8 |
dbAllOk | boolean | R | Both trusted database connections is ok. |
9 |
db1TrustCon | boolean | R | Trust connection to database 1 server ok. |
10 |
db2TrustCon | boolean | R | Trust connection to database 2 server ok. |
Last Modified 17 January 2024