Daggos

ODBC Database alarm logging

Recommended Posts

Hi,

I cant get the date to work when logging alarms to database im using mariadb mysql

this is what i get 

0000-00-00

test Test;Test; 4

F

with the logging sets i have set Custom Time Formatting to %Y%m%d%H%M%S , but i cant do that with alarms.

 

--
-- Table structure for table `alarmlog`
--

CREATE TABLE `alarmlog` (
  `TheTime` date DEFAULT NULL,
  `Name` text DEFAULT NULL,
  `Description` text DEFAULT NULL,
  `Priority` tinytext DEFAULT NULL,
  `Status` tinytext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
COMMIT;

Share this post


Link to post
Share on other sites

It posts the time in Excel time format, meaning as a number that is decimal days since 1900.  This is what worked on the databases we tested when this was first added, but obviously appears to not always work.  You have two options:

1) change "TheTime" to a floating point instead of date.  Then it should post correctly, but of course then the time stamp will be a number instead of something human readable.  You also might try setting TheTime to datetime instead of just date.

2) log alarms yourself using the alarm events and a sequence function to do the logging and db. functions.  This will allow you to log however you want.  The only challenge is that you have to go through all of your alarms and add a line of script for each of the 3 events you want to log.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now