Erlang -- nteventlog

Reference Manual
Release Notes
PDF
Top

OS_Mon
Reference Manual
Version 2.2.10

Expand All
Contract All

Table of Contents

- os_mon (App)
- cpu_sup
  - Top of manual page
  - nprocs/0
  - avg1/0
  - avg5/0
  - avg15/0
  - util/0
  - util/1
- disksup
  - Top of manual page
  - get_disk_data/0
  - get_check_interval/0
  - set_check_interval/1
  - get_almost_full_threshold/0
  - set_almost_full_threshold/1
- memsup
  - Top of manual page
  - get_memory_data/0
  - get_system_memory_data/0
  - get_os_wordsize/0
  - get_check_interval/0
  - set_check_interval/1
  - get_procmem_high_watermark/0
  - set_procmem_high_watermark/1
  - get_sysmem_high_watermark/0
  - set_sysmem_high_watermark/1
  - get_helper_timeout/0
  - set_helper_timeout/1
- os_mon_mib
  - Top of manual page
  - load/1
  - unload/1
- os_sup
  - Top of manual page
  - enable/0
  - enable/2
  - disable/0
  - disable/2
- nteventlog
  - Top of manual page
  - start/2
  - start_link/2
  - stop/0

# nteventlog

### MODULE

nteventlog

### MODULE SUMMARY

Interface to Windows Event Log

### DESCRIPTION

nteventlog provides a generic interface to the Windows event log. It is part of the OS_Mon application, see os_mon(6). Available for Windows versions where the event log is available. That is, not for Windows 98 and some other older Windows versions, but for most (all?) newer Windows versions.

This module is used as the Windows backend for os_sup, see os_sup(3).

To retain backwards compatibility, this module can also be used to start a standalone nteventlog process which is not part of the OS_Mon supervision tree. When starting such a process, the user has to supply an identifier as well as a callback function to handle the messages.

The identifier, an arbitrary string, should be reused whenever the same application (or node) wants to start the process. nteventlog is informed about all events that have arrived to the eventlog since the last accepted message for the current identifier. As long as the same identifier is used, the same eventlog record will not be sent to nteventlog more than once (with the exception of when graved system failures arise, in which case the last records written before the failure may be sent to Erlang again after reboot).

If the event log is configured to wrap around automatically, records that have arrived to the log and been overwritten when nteventlog was not running are lost. It however detects this state and loses no records that are not overwritten.

The callback function works as described in os_sup(3).

### EXPORTS

start(Identifier, MFA) -> Result
start_link(Identifier, MFA) -> Result

Types:

Identifier = string() | atom()
MFA = {Mod, Func, Args}
Mod = Func = atom()
Args = [term()]
Result = {ok, Pid} | {error, {already_started, Pid}}
Pid = pid()

This function starts the standalone nteventlog process and, if start_link/2 is used, links to it.

Identifier is an identifier as described above.

MFA is the supplied callback function. When nteventlog receives information about a new event, this function will be called as apply(Mod, Func, [Event|Args]) where Event is a tuple

stop() -> stopped

Types:

Result = stopped

Stops nteventlog. Usually only used during development. The server does not have to be shut down gracefully to maintain its state.

### See Also

os_mon(6), os_sup(3)

Windows NT documentation