Email/logging format discussions


Recommended Posts

Forked from another thread.

 

The main points that IMO should be in any mail subject sent from the unRAID system should be

 

Hostname or IP or both

Date and Time in long format i.e. 17th July 2008 (I find the swapping of month and day regionlisation so annoying)

A general classification such as INFO, WARNING CRITICAL etc

A specific numeric message type identifier. aka an error code.

A summary message

 

Id alos like to see these fields all delimited for easy parsing.

 

Others had similar ideas i will leave them to quote their own posts over.

Link to comment

As far as a consistent "subject"  I disagree a tiny bit.

 

By consistent, I meant standardized. I agree messages have to "look" different.

But Identification fields of the messages should be consistent as far HOST Timing STATUS program and MESSAGE.

 

Example:

 

[hostname] DATETIME CONDITION  PROGRAM "MESSAGE"

 

[Tower] 07/16/08 22:22:22 ALERT hddtemp /dev/sda is at 40c.

[Tower] 07/16/08 22:22:22 STATUS smartcheck S.M.A.R.T. Health is OK.

[Tower] 07/16/08 22:22:22 WARNING smartcheck S.M.A.R.T. Health /dev/sda needs review.

[Tower] 07/16/08 22:22:22 ERROR syslogcheck: ide error detected in /var/log/syslog.

[Tower] 07/16/08 22:22:22 WARNING drivespace drive /dev/md1 utilization > 90%.

[Tower] 07/16/08 22:22:22 CRITICAL drivespace drive /dev/md2 utilization > 97%.

[Tower] 07/16/08 22:22:22 ERROR drivemount: /dev/md1 is not mounted.

[Tower] 07/16/08 22:22:22 STATUS array parity sync active progress 60%.

[Tower] 07/16/08 22:22:22 STATUS array parity sync complete.

 

 

So we have the following conditions.

 

STATUS Notification condition

ERROR Notification condition which could cause problems.

ALERT (level 1 condition) requires action.

WARNING (level 2 condition) requires action.

CRITICAL (level 3 condition) Requires action.

I could live with something like that, but to make it easier to sort the mail messages, you might want to make the date format something that sorts lexically.

 

[Tower] 2008-02-17 22:22:22 CRITICAL: turbo encabulator prefabulated amulite spurving bearing alignment is required.

 

I know the date is not in an international format, but it will sort correctly by date/time when you sort by title.

 

Joe L.

 

Actually your format fo the date is an international standard date format.

 

http://www.w3.org/QA/Tips/iso-date

The ISO date format

 

The international format defined by ISO (ISO 8601) tries to address all these problems by defining a numerical date system as follows: YYYY-MM-DD where

 

    * YYYY is the year [all the digits, i.e. 2012]

    * MM is the month [01 (January) to 12 (December)]

    * DD is the day [01 to 31]

 

For example, "3rd of April 2002", in this international format is written: 2002-04-03.

 

Note that this format can also be used to represent precise date and time, with timezone information

Link to comment

>> Date and Time in long format i.e. 17th July 2008 (I find the swapping of month and day regionlisation so annoying)

 

I think using the ISO-DATE format would be wiser.

 

> A general classification such as INFO, WARNING CRITICAL etc

Agreed, I suppose we need to agree on the class of messages I suggested a few.

 

> A specific numeric message type identifier. aka an error code.

Not sure if this is worthwhile. I think it's application specific.

This would force every package installed to agree on a catalog of messages.

Unless it follows the application name, would not want it to follow the status level as this may confuse things during sorts.

 

> A summary message

I think application name (numeric code) then summary message.

 

Link to comment

Actually your format fo the date is an international standard date format.

 

http://www.w3.org/QA/Tips/iso-date

The ISO date format

 

The international format defined by ISO (ISO 8601) tries to address all these problems by defining a numerical date system as follows: YYYY-MM-DD where

 

    * YYYY is the year [all the digits, i.e. 2012]

    * MM is the month [01 (January) to 12 (December)]

    * DD is the day [01 to 31]

 

For example, "3rd of April 2002", in this international format is written: 2002-04-03.

 

Note that this format can also be used to represent precise date and time, with timezone information

 

Well, what do  you know...  I guess it is a standard.  If only I had published it as MY standard first.  It would have saved that ISO committee hours of time ;) 

 

I've run into this issue in information systems as far back as I can remember.  Especially with very old systems that stored everything as character data. (Yeah, I'm not that old, but was required to do data conversions on systems that were) 

 

Joe L.

Link to comment

[Yeah, I'm not that old, but was required to do data conversions on systems that were)   

 

Joe L.

I bet you know COBOL too!

Nope... I had to read COBOL, to do functional decomposition of legacy systems, but never had to code in COBOL.   

 

I once interviewed for a COBOL programming position... he asked how much experience I had in COBOL. I said "None", but it is just syntax.  I've learned so many different languages over the years that as often as not I'm asked to lead development teams on new 4GL languages nobody's seen before.  A 3GL is easy. All languages have assignment of variables, iteration, and conditional logic. More modern languages are more tightly scoped having properties and methods assigned to objects. The rest is just where to put the semi-colons.  ;D  I didn't get the job  ;) but then I was just practicing my interview skills with him.

 

Joe L.

Link to comment

How about you define the interface for a notifier black box, and separate out the notifier from the base applications.  Notifier can be self contained and modularized so people that add pager, SMS messaging, e-mail, even SNMP traps as modules to the alerter.

 

Define the interface, and applications  will come.

 

Good Idea!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.