aboutsummaryrefslogtreecommitdiffstats
path: root/lib/os_mon/doc/src
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2009-11-20 14:54:40 +0000
committerErlang/OTP <[email protected]>2009-11-20 14:54:40 +0000
commit84adefa331c4159d432d22840663c38f155cd4c1 (patch)
treebff9a9c66adda4df2106dfd0e5c053ab182a12bd /lib/os_mon/doc/src
downloadotp-84adefa331c4159d432d22840663c38f155cd4c1.tar.gz
otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.bz2
otp-84adefa331c4159d432d22840663c38f155cd4c1.zip
The R13B03 release.OTP_R13B03
Diffstat (limited to 'lib/os_mon/doc/src')
-rw-r--r--lib/os_mon/doc/src/Makefile124
-rw-r--r--lib/os_mon/doc/src/book.xml45
-rw-r--r--lib/os_mon/doc/src/cpu_sup.xml281
-rw-r--r--lib/os_mon/doc/src/disksup.xml161
-rw-r--r--lib/os_mon/doc/src/fascicules.xml15
-rw-r--r--lib/os_mon/doc/src/make.dep21
-rw-r--r--lib/os_mon/doc/src/memsup.xml328
-rw-r--r--lib/os_mon/doc/src/note.gifbin0 -> 1539 bytes
-rw-r--r--lib/os_mon/doc/src/notes.xml537
-rw-r--r--lib/os_mon/doc/src/nteventlog.xml104
-rw-r--r--lib/os_mon/doc/src/os_mon_app.xml126
-rw-r--r--lib/os_mon/doc/src/os_mon_mib.xml70
-rw-r--r--lib/os_mon/doc/src/os_sup.xml241
-rw-r--r--lib/os_mon/doc/src/part_notes.xml36
-rw-r--r--lib/os_mon/doc/src/ref_man.xml42
-rw-r--r--lib/os_mon/doc/src/user_guide.gifbin0 -> 1581 bytes
-rw-r--r--lib/os_mon/doc/src/warning.gifbin0 -> 1498 bytes
17 files changed, 2131 insertions, 0 deletions
diff --git a/lib/os_mon/doc/src/Makefile b/lib/os_mon/doc/src/Makefile
new file mode 100644
index 0000000000..c9765749c9
--- /dev/null
+++ b/lib/os_mon/doc/src/Makefile
@@ -0,0 +1,124 @@
+#
+# %CopyrightBegin%
+#
+# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+#
+# The contents of this file are subject to the Erlang Public License,
+# Version 1.1, (the "License"); you may not use this file except in
+# compliance with the License. You should have received a copy of the
+# Erlang Public License along with this software. If not, it can be
+# retrieved online at http://www.erlang.org/.
+#
+# Software distributed under the License is distributed on an "AS IS"
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+# the License for the specific language governing rights and limitations
+# under the License.
+#
+# %CopyrightEnd%
+#
+include $(ERL_TOP)/make/target.mk
+include $(ERL_TOP)/make/$(TARGET)/otp.mk
+
+# ----------------------------------------------------
+# Application version
+# ----------------------------------------------------
+include ../../vsn.mk
+VSN=$(OS_MON_VSN)
+APPLICATION=os_mon
+
+# ----------------------------------------------------
+# Release directory specification
+# ----------------------------------------------------
+RELSYSDIR = $(RELEASE_PATH)/lib/$(APPLICATION)-$(VSN)
+
+# ----------------------------------------------------
+# Target Specs
+# ----------------------------------------------------
+XML_APPLICATION_FILES = ref_man.xml
+XML_REF3_FILES = cpu_sup.xml \
+ disksup.xml \
+ memsup.xml \
+ os_mon_mib.xml \
+ os_sup.xml \
+ nteventlog.xml
+
+XML_REF6_FILES = os_mon_app.xml
+
+XML_PART_FILES = part_notes.xml
+XML_CHAPTER_FILES = notes.xml
+
+BOOK_FILES = book.xml
+
+GIF_FILES = \
+ note.gif \
+ warning.gif
+
+XML_FILES = \
+ $(BOOK_FILES) $(XML_CHAPTER_FILES) \
+ $(XML_PART_FILES) $(XML_REF3_FILES) $(XML_REF6_FILES) $(XML_APPLICATION_FILES)
+
+# ----------------------------------------------------
+
+HTML_FILES = $(XML_APPLICATION_FILES:%.xml=$(HTMLDIR)/%.html) \
+ $(XML_PART_FILES:%.xml=$(HTMLDIR)/%.html)
+
+INFO_FILE = ../../info
+
+MAN3_FILES = $(XML_REF3_FILES:%.xml=$(MAN3DIR)/%.3)
+
+MAN6_FILES = $(XML_REF6_FILES:%_app.xml=$(MAN6DIR)/%.6)
+
+HTML_REF_MAN_FILE = $(HTMLDIR)/index.html
+
+TOP_PDF_FILE = $(PDFDIR)/$(APPLICATION)-$(VSN).pdf
+
+# ----------------------------------------------------
+# FLAGS
+# ----------------------------------------------------
+XML_FLAGS +=
+
+# ----------------------------------------------------
+# Targets
+# ----------------------------------------------------
+$(HTMLDIR)/%.gif: %.gif
+ $(INSTALL_DATA) $< $@
+
+docs: pdf html man
+
+$(TOP_PDF_FILE): $(XML_FILES)
+
+pdf: $(TOP_PDF_FILE)
+
+html: gifs $(HTML_REF_MAN_FILE)
+
+man: $(MAN3_FILES) $(MAN6_FILES)
+
+gifs: $(GIF_FILES:%=$(HTMLDIR)/%)
+
+debug opt:
+
+clean clean_docs:
+ rm -rf $(HTMLDIR)/*
+ rm -f $(MAN3DIR)/*
+ rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
+ rm -f errs core *~
+
+# ----------------------------------------------------
+# Release Target
+# ----------------------------------------------------
+include $(ERL_TOP)/make/otp_release_targets.mk
+
+release_docs_spec: docs
+ $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf
+ $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf
+ $(INSTALL_DIR) $(RELSYSDIR)/doc/html
+ $(INSTALL_DATA) $(HTMLDIR)/* \
+ $(RELSYSDIR)/doc/html
+ $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR)
+ $(INSTALL_DIR) $(RELEASE_PATH)/man/man3
+ $(INSTALL_DATA) $(MAN3DIR)/* $(RELEASE_PATH)/man/man3
+ $(INSTALL_DIR) $(RELEASE_PATH)/man/man6
+ $(INSTALL_DATA) $(MAN6DIR)/* $(RELEASE_PATH)/man/man6
+
+release_spec:
+
diff --git a/lib/os_mon/doc/src/book.xml b/lib/os_mon/doc/src/book.xml
new file mode 100644
index 0000000000..17645b81fd
--- /dev/null
+++ b/lib/os_mon/doc/src/book.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="latin1" ?>
+<!DOCTYPE book SYSTEM "book.dtd">
+
+<book xmlns:xi="http://www.w3.org/2001/XInclude">
+ <header titlestyle="normal">
+ <copyright>
+ <year>1997</year><year>2009</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ </legalnotice>
+
+ <title>OS_Mon</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ </header>
+ <insidecover>
+ </insidecover>
+ <pagetext>OS_Mon</pagetext>
+ <preamble>
+ <contents level="2"></contents>
+ </preamble>
+ <applications>
+ <xi:include href="ref_man.xml"/>
+ </applications>
+ <releasenotes>
+ <xi:include href="notes.xml"/>
+ </releasenotes>
+ <listofterms></listofterms>
+ <index></index>
+</book>
+
diff --git a/lib/os_mon/doc/src/cpu_sup.xml b/lib/os_mon/doc/src/cpu_sup.xml
new file mode 100644
index 0000000000..7b28083fbc
--- /dev/null
+++ b/lib/os_mon/doc/src/cpu_sup.xml
@@ -0,0 +1,281 @@
+<?xml version="1.0" encoding="latin1" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>1997</year><year>2009</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ </legalnotice>
+
+ <title>cpu_sup</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ </header>
+ <module>cpu_sup</module>
+ <modulesummary>A CPU Load and CPU Utilization Supervisor Process</modulesummary>
+ <description>
+ <p><c>cpu_sup</c> is a process which supervises the CPU load
+ and CPU utilization. It is part of the OS_Mon application, see
+ <seealso marker="os_mon_app">os_mon(6)</seealso>. Available for Unix,
+ although CPU utilization values (<c>util/0,1</c>) are only
+ available for Solaris and Linux.</p>
+ <p>The load values are proportional to how long time a runnable
+ Unix process has to spend in the run queue before it is scheduled.
+ Accordingly, higher values mean more system load. The returned
+ value divided by 256 produces the figure displayed by <c>rup</c>
+ and <c>top</c>. What is displayed as 2.00 in <c>rup</c>, is
+ displayed as load up to the second mark in <c>xload</c>.</p>
+ <p>For example, <c>rup</c> displays a load of 128 as 0.50, and
+ 512 as 2.00.</p>
+ <p>If the user wants to view load values as percentage of machine
+ capacity, then this way of measuring presents a problem, because
+ the load values are not restricted to a fixed interval. In this
+ case, the following simple mathematical transformation can
+ produce the load value as a percentage:</p>
+ <code type="none">
+ PercentLoad = 100 * (1 - D/(D + Load))
+ </code>
+ <p><c>D</c> determines which load value should be associated with
+ which percentage. Choosing <c>D</c> = 50 means that 128 is 60%
+ load, 256 is 80%, 512 is 90%, and so on.</p>
+ <p>Another way of measuring system load is to divide the number of
+ busy CPU cycles by the total number of CPU cycles. This produces
+ values in the 0-100 range immediately. However, this method hides
+ the fact that a machine can be more or less saturated. CPU
+ utilization is therefore a better name than system load for this
+ measure.</p>
+ <p>A server which receives just enough requests to never become
+ idle will score a CPU utilization of 100%. If the server receives
+ 50% more requests, it will still scores 100%. When the system load
+ is calculated with the percentage formula shown previously,
+ the load will increase from 80% to 87%.</p>
+ <p>The <c>avg1/0</c>, <c>avg5/0</c>, and <c>avg15/0</c> functions
+ can be used for retrieving system load values, and
+ the <c>util/0</c> and <c>util/1</c> functions can be used for
+ retrieving CPU utilization values.</p>
+ <p>When run on Linux, <c>cpu_sup</c> assumes that the <c>/proc</c>
+ file system is present and accessible by <c>cpu_sup</c>. If it is
+ not, <c>cpu_sup</c> will terminate.</p>
+ </description>
+ <funcs>
+ <func>
+ <name>nprocs() -> UnixProcesses | {error, Reason}</name>
+ <fsummary>Get the number of UNIX processes running on this host</fsummary>
+ <type>
+ <v>UnixProcesses = int()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Returns the number of UNIX processes running on this machine.
+ This is a crude way of measuring the system load, but it may
+ be of interest in some cases.</p>
+ <p>Returns 0 if <c>cpu_sup</c> is not available.</p>
+ </desc>
+ </func>
+ <func>
+ <name>avg1() -> SystemLoad | {error, Reason}</name>
+ <fsummary>Get the system load average for the last minute</fsummary>
+ <type>
+ <v>SystemLoad = int()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Returns the average system load in the last minute, as
+ described above. 0 represents no load, 256 represents the load
+ reported as 1.00 by <c>rup</c>.</p>
+ <p>Returns 0 if <c>cpu_sup</c> is not available.</p>
+ </desc>
+ </func>
+ <func>
+ <name>avg5() -> SystemLoad | {error, Reason}</name>
+ <fsummary>Get the system load average for the last five minutes</fsummary>
+ <type>
+ <v>SystemLoad = int()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Returns the average system load in the last five minutes, as
+ described above. 0 represents no load, 256 represents the load
+ reported as 1.00 by <c>rup</c>.</p>
+ <p>Returns 0 if <c>cpu_sup</c> is not available.</p>
+ </desc>
+ </func>
+ <func>
+ <name>avg15() -> SystemLoad | {error, Reason}</name>
+ <fsummary>Get the system load average for the last fifteen minutes</fsummary>
+ <type>
+ <v>SystemLoad = int()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Returns the average system load in the last 15 minutes, as
+ described above. 0 represents no load, 256 represents the load
+ reported as 1.00 by <c>rup</c>.</p>
+ <p>Returns 0 if <c>cpu_sup</c> is not available.</p>
+ </desc>
+ </func>
+ <func>
+ <name>util() -> CpuUtil | {error, Reason}</name>
+ <fsummary>Get the CPU utilization</fsummary>
+ <type>
+ <v>CpuUtil = float()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Returns CPU utilization since the last call to
+ <c>util/0</c> or <c>util/1</c> by the calling process.</p>
+ <note>
+ <p>The returned value of the first call to <c>util/0</c> or
+ <c>util/1</c> by a process will on most systems be the CPU
+ utilization since system boot, but this is not guaranteed
+ and the value should therefore be regarded as garbage. This
+ also applies to the first call after a restart of
+ <c>cpu_sup</c>.</p>
+ </note>
+ <p>The CPU utilization is defined as the sum of the percentage
+ shares of the CPU cycles spent in all busy processor states
+ (see <c>util/1</c> below) in average on all CPUs.</p>
+ <p>Returns 0 if <c>cpu_sup</c> is not available.</p>
+ </desc>
+ </func>
+ <func>
+ <name>util(Opts) -> UtilSpec | {error, Reason}</name>
+ <fsummary>Get the CPU utilization</fsummary>
+ <type>
+ <v>Opts = [detailed | per_cpu]</v>
+ <v>UtilSpec = UtilDesc | [UtilDesc]</v>
+ <v>&nbsp;UtilDesc = {Cpus, Busy, NonBusy, Misc}</v>
+ <v>&nbsp;&nbsp;Cpus = all | int() | [int()]()</v>
+ <v>&nbsp;&nbsp;Busy = NonBusy = {State, Share} | Share</v>
+ <v>&nbsp;&nbsp;&nbsp;State = user | nice_user | kernel</v>
+ <v>&nbsp;&nbsp;&nbsp;&nbsp;| wait | idle | atom()</v>
+ <v>&nbsp;&nbsp;&nbsp;Share = float()</v>
+ <v>&nbsp;&nbsp;Misc = []</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Returns CPU utilization since the last call to
+ <c>util/0</c> or <c>util/1</c> by the calling process, in
+ more detail than <c>util/0</c>.</p>
+ <note>
+ <p>The returned value of the first call to <c>util/0</c> or
+ <c>util/1</c> by a process will on most systems be the CPU
+ utilization since system boot, but this is not guaranteed
+ and the value should therefore be regarded as garbage. This
+ also applies to the first call after a restart of
+ <c>cpu_sup</c>.</p>
+ </note>
+ <p>Currently recognized options:</p>
+ <taglist>
+ <tag><c>detailed</c></tag>
+ <item>
+ <p>The returned <c>UtilDesc</c>(s) will be even more
+ detailed.</p>
+ </item>
+ <tag><c>per_cpu</c></tag>
+ <item>
+ <p>Each CPU will be specified separately (assuming this
+ information can be retrieved from the operating system),
+ that is, a list with one <c>UtilDesc</c> per CPU will be
+ returned.</p>
+ </item>
+ </taglist>
+ <p>Description of <c>UtilDesc = {Cpus, Busy, NonBusy, Misc}</c>:</p>
+ <taglist>
+ <tag><c>Cpus</c></tag>
+ <item>
+ <p>If the <c>detailed</c> and/or <c>per_cpu</c> option is
+ given, this is the CPU number, or a list of the CPU
+ numbers.</p>
+ <p>If not, this is the atom <c>all</c> which implies that
+ the <c>UtilDesc</c> contains information about all CPUs.</p>
+ </item>
+ <tag><c>Busy</c></tag>
+ <item>
+ <p>If the <c>detailed</c> option is given, this is a list
+ of <c>{State, Share}</c> tuples, where each tuple
+ contains information about a processor state that has
+ been identified as a busy processor state (see below).
+ The atom <c>State</c> is the name of the state, and
+ the float <c>Share</c> represents the percentage share of
+ the CPU cycles spent in this state since the last call to
+ <c>util/0</c> or <c>util/1</c>.</p>
+ <p>If not, this is the sum of the percentage shares of
+ the CPU cycles spent in all states identified as busy.</p>
+ <p>If the <c>per_cpu</c> is not given, the value(s)
+ presented are the average of all CPUs.</p>
+ </item>
+ <tag><c>NonBusy</c></tag>
+ <item>
+ <p>Similar to <c>Busy</c>, but for processor states that
+ have been identified as non-busy (see below).</p>
+ </item>
+ <tag><c>Misc</c></tag>
+ <item>
+ <p>Currently unused; reserved for future use.</p>
+ </item>
+ </taglist>
+ <p>Currently these processor states are identified as busy:</p>
+ <taglist>
+ <tag><c>user</c></tag>
+ <item>
+ <p>Executing code in user mode.</p>
+ </item>
+ <tag><c>nice_user</c></tag>
+ <item>
+ <p>Executing code in low priority (nice) user mode.
+ This state is currently only identified on Linux.</p>
+ </item>
+ <tag><c>kernel</c></tag>
+ <item>
+ <p>Executing code in kernel mode.</p>
+ </item>
+ </taglist>
+ <p>Currently these processor states are identified as non-busy:</p>
+ <taglist>
+ <tag><c>wait</c></tag>
+ <item>
+ <p>Waiting. This state is currently only identified on
+ Solaris.</p>
+ </item>
+ <tag><c>idle</c></tag>
+ <item>
+ <p>Idle.</p>
+ </item>
+ </taglist>
+ <note>
+ <p>Identified processor states may be different on different
+ operating systems and may change between different versions
+ of <c>cpu_sup</c> on the same operating system. The sum of
+ the percentage shares of the CPU cycles spent in all busy
+ and all non-busy processor states will always add up to
+ 100%, though.</p>
+ </note>
+ <p>Returns <c>{all,0,0,[]}</c> if <c>cpu_sup</c> is not
+ available.</p>
+ </desc>
+ </func>
+ </funcs>
+
+ <section>
+ <title>See Also</title>
+ <p><seealso marker="os_mon_app">os_mon(3)</seealso></p>
+ </section>
+</erlref>
+
diff --git a/lib/os_mon/doc/src/disksup.xml b/lib/os_mon/doc/src/disksup.xml
new file mode 100644
index 0000000000..bfa3d3578f
--- /dev/null
+++ b/lib/os_mon/doc/src/disksup.xml
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="latin1" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>1996</year><year>2009</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ </legalnotice>
+
+ <title>disksup</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ </header>
+ <module>disksup</module>
+ <modulesummary>A Disk Supervisor Process</modulesummary>
+ <description>
+ <p><c>disksup</c> is a process which supervises the available disk
+ space in the system. It is part of the OS_Mon application, see
+ <seealso marker="os_mon_app">os_mon(6)</seealso>. Available for Unix
+ and Windows.</p>
+ <p>Periodically checks the disks. For each disk or partition which
+ uses more than a certain amount of the available space, the alarm
+ <c>{{disk_almost_full, MountedOn}, []}</c> is set.</p>
+ <taglist>
+ <tag>On Unix</tag>
+ <item>
+ <p>All (locally) mounted disks are checked, including the swap
+ disk if it is present.</p>
+ </item>
+ <tag>On WIN32</tag>
+ <item>
+ <p>All logical drives of type "FIXED_DISK" are checked.</p>
+ </item>
+ </taglist>
+ <p>Alarms are reported to the SASL alarm handler, see
+ <seealso marker="sasl:alarm_handler">alarm_handler(3)</seealso>.
+ To set an alarm, <c>alarm_handler:set_alarm(Alarm)</c> is called
+ where <c>Alarm</c> is the alarm specified above.</p>
+ <p>The alarms are cleared automatically when the alarm cause is no
+ longer valid.</p>
+ </description>
+
+ <section>
+ <marker id="config"></marker>
+ <title>Configuration</title>
+ <p>The following configuration parameters can be used to change
+ the default values for time interval and threshold:</p>
+ <taglist>
+ <tag><c>disk_space_check_interval = int()>0</c></tag>
+ <item>
+ <p>The time interval, in minutes, for the periodic disk space
+ check. The default is 30 minutes.</p>
+ </item>
+ <tag><c>disk_almost_full_threshold = float()</c></tag>
+ <item>
+ <p>The threshold, as percentage of total disk space, for how
+ much disk can be utilized before the <c>disk_almost_full</c>
+ alarm is set. The default is 0.80 (80%).</p>
+ </item>
+ </taglist>
+ <p>See <seealso marker="kernel:config">config(4)</seealso> for
+ information about how to change the value of configuration
+ parameters.</p>
+ </section>
+ <funcs>
+ <func>
+ <name>get_disk_data() -> [DiskData]</name>
+ <fsummary>Get data for the disks in the system</fsummary>
+ <type>
+ <v>DiskData = {Id, KByte, Capacity}</v>
+ <v>&nbsp;Id = string()</v>
+ <v>&nbsp;KByte = int()</v>
+ <v>&nbsp;Capacity = int()</v>
+ </type>
+ <desc>
+ <p>Returns the result of the latest disk check. <c>Id</c> is a
+ string that identifies the disk or partition. <c>KByte</c> is
+ the total size of the disk or partition in kbytes.
+ <c>Capacity</c> is the percentage of disk space used.</p>
+ <p>The function is asynchronous in the sense that it does not
+ invoke a disk check, but returns the latest available value.</p>
+ <p>Returns <c>[{"none",0,0}]</c> if <c>disksup</c> is not
+ available.</p>
+ </desc>
+ </func>
+ <func>
+ <name>get_check_interval() -> MS</name>
+ <fsummary>Get time interval, in milliseconds, for the periodic disk space check</fsummary>
+ <type>
+ <v>MS = int()</v>
+ </type>
+ <desc>
+ <p>Returns the time interval, in milliseconds, for the periodic
+ disk space check.</p>
+ </desc>
+ </func>
+ <func>
+ <name>set_check_interval(Minutes) -> ok</name>
+ <fsummary>Set time interval, in minutes, for the periodic disk space check</fsummary>
+ <type>
+ <v>Minutes = int()>=1</v>
+ </type>
+ <desc>
+ <p>Changes the time interval, given in minutes, for the periodic
+ disk space check.</p>
+ <p>The change will take effect after the next disk space check
+ and is non-persist. That is, in case of a process restart,
+ this value is forgotten and the default value will be used.
+ See <seealso marker="#config">Configuration</seealso> above.</p>
+ </desc>
+ </func>
+ <func>
+ <name>get_almost_full_threshold() -> Percent</name>
+ <fsummary>Get threshold, in percent, for disk space utilization</fsummary>
+ <type>
+ <v>Percent = int()</v>
+ </type>
+ <desc>
+ <p>Returns the threshold, in percent, for disk space utilization.</p>
+ </desc>
+ </func>
+ <func>
+ <name>set_almost_full_threshold(Float) -> ok</name>
+ <fsummary>Set threshold, as percentage represented by a float, for disk space utilization</fsummary>
+ <type>
+ <v>Float = float(), 0=&lt;Float=&lt;1</v>
+ </type>
+ <desc>
+ <p>Changes the threshold, given as a float, for disk space
+ utilization.</p>
+ <p>The change will take effect during the next disk space check
+ and is non-persist. That is, in case of a process restart,
+ this value is forgotten and the default value will be used.
+ See <seealso marker="#config">Configuration</seealso> above.</p>
+ </desc>
+ </func>
+ </funcs>
+
+ <section>
+ <title>See Also</title>
+ <p><seealso marker="sasl:alarm_handler">alarm_handler(3)</seealso>,
+ <seealso marker="os_mon_app">os_mon(3)</seealso></p>
+ </section>
+</erlref>
+
diff --git a/lib/os_mon/doc/src/fascicules.xml b/lib/os_mon/doc/src/fascicules.xml
new file mode 100644
index 0000000000..43090b4aed
--- /dev/null
+++ b/lib/os_mon/doc/src/fascicules.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="latin1" ?>
+<!DOCTYPE fascicules SYSTEM "fascicules.dtd">
+
+<fascicules>
+ <fascicule file="ref_man" href="ref_man_frame.html" entry="yes">
+ Reference Manual
+ </fascicule>
+ <fascicule file="part_notes" href="part_notes_frame.html" entry="no">
+ Release Notes
+ </fascicule>
+ <fascicule file="" href="../../../../doc/print.html" entry="no">
+ Off-Print
+ </fascicule>
+</fascicules>
+
diff --git a/lib/os_mon/doc/src/make.dep b/lib/os_mon/doc/src/make.dep
new file mode 100644
index 0000000000..b657f2e036
--- /dev/null
+++ b/lib/os_mon/doc/src/make.dep
@@ -0,0 +1,21 @@
+# ----------------------------------------------------
+# >>>> Do not edit this file <<<<
+# This file was automaticly generated by
+# /home/otp/bin/docdepend
+# ----------------------------------------------------
+
+
+# ----------------------------------------------------
+# TeX files that the DVI file depend on
+# ----------------------------------------------------
+
+book.dvi: book.tex cpu_sup.tex disksup.tex memsup.tex \
+ nteventlog.tex os_mon.tex os_mon_mib.tex os_sup.tex \
+ ref_man.tex
+
+# ----------------------------------------------------
+# Source inlined when transforming from source to LaTeX
+# ----------------------------------------------------
+
+book.tex: ref_man.xml
+
diff --git a/lib/os_mon/doc/src/memsup.xml b/lib/os_mon/doc/src/memsup.xml
new file mode 100644
index 0000000000..67d617375e
--- /dev/null
+++ b/lib/os_mon/doc/src/memsup.xml
@@ -0,0 +1,328 @@
+<?xml version="1.0" encoding="latin1" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>1996</year><year>2009</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ </legalnotice>
+
+ <title>memsup</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ </header>
+ <module>memsup</module>
+ <modulesummary>A Memory Supervisor Process</modulesummary>
+ <description>
+ <p><c>memsup</c> is a process which supervises the memory usage for
+ the system and for individual processes. It is part of the OS_Mon
+ application, see <seealso marker="os_mon_app">os_mon(6)</seealso>.
+ Available for Unix, Windows and VxWorks.</p>
+ <p>Periodically performs a memory check:</p>
+ <list type="bulleted">
+ <item>
+ <p>If more than a certain amount of available system memory is
+ allocated, as reported by the underlying operating system,
+ the alarm <c>{system_memory_high_watermark, []}</c> is set.</p>
+ </item>
+ <item>
+ <p>If any Erlang process <c>Pid</c> in the system has allocated
+ more than a certain amount of total system memory, the alarm
+ <c>{process_memory_high_watermark, Pid}</c> is set.</p>
+ </item>
+ </list>
+ <p>Alarms are reported to the SASL alarm handler, see
+ <seealso marker="sasl:alarm_handler">alarm_handler(3)</seealso>.
+ To set an alarm, <c>alarm_handler:set_alarm(Alarm)</c> is called
+ where <c>Alarm</c> is either of the alarms specified above.</p>
+ <p>The alarms are cleared automatically when the alarm cause is no
+ longer valid.</p>
+ <p>The function
+ <seealso marker="#get_memory_data/0">get_memory_data()</seealso>
+ can be used to retrieve the result of the latest periodic memory
+ check.</p>
+ <p>There is also a interface to system dependent memory data,
+ <seealso marker="#get_system_memory_data/0">get_system_memory_data()</seealso>.
+ The result is highly dependent on the underlying operating
+ system and the interface is targeted primarily for systems
+ without virtual memory (e.g. VxWorks). The output on other
+ systems is however still valid, although sparse.</p>
+ <p>A call to <c>get_system_memory_data/0</c> is more costly
+ than a call to <c>get_memory_data/0</c> as data is collected
+ synchronously when this function is called.</p>
+ <p>The total system memory reported under UNIX is the number of
+ physical pages of memory times the page size, and the available
+ memory is the number of available physical pages times the page
+ size. This is a reasonable measure as swapping should be avoided
+ anyway, but the task of defining total memory and available
+ memory is difficult because of virtual memory and swapping.</p>
+ </description>
+
+ <section>
+ <marker id="config"></marker>
+ <title>Configuration</title>
+ <p>The following configuration parameters can be used to change
+ the default values for time intervals and thresholds:</p>
+ <taglist>
+ <tag><c>memory_check_interval = int()>0</c></tag>
+ <item>
+ <p>The time interval, in minutes, for the periodic memory check.
+ The default is one minute.</p>
+ </item>
+ <tag><c>system_memory_high_watermark = float()</c></tag>
+ <item>
+ <p>The threshold, as percentage of system memory, for how much
+ system memory can be allocated before the corresponding alarm
+ is set. The default is 0.80 (80%).</p>
+ </item>
+ <tag><c>process_memory_high_watermark = float()</c></tag>
+ <item>
+ <p>The threshold, as percentage of system memory, for how much
+ system memory can be allocated by one Erlang process before
+ the corresponding alarm is set. The default is 0.05 (5%).</p>
+ </item>
+ <tag><c>memsup_helper_timeout = int()>0</c></tag>
+ <item>
+ <p>A timeout, in seconds, for how long the <c>memsup</c>
+ process should wait for a result from a memory check. If
+ the timeout expires, a warning message <c>"OS_MON (memsup) timeout"</c> is issued via <c>error_logger</c> and any
+ pending, synchronous client calls will return a dummy value.
+ Normally, this situation should not occur. There have been
+ cases on Linux, however, where the pseudo file from which
+ system data is read is temporarily unavailable when the system
+ is heavily loaded.</p>
+ <p>The default is 30 seconds. </p>
+ </item>
+ <tag><c>memsup_system_only = bool()</c></tag>
+ <item>
+ <p>Specifies whether the <c>memsup</c> process should only
+ check system memory usage (<c>true</c>) or not. The default is
+ <c>false</c>, meaning that information regarding both system
+ memory usage and Erlang process memory usage is collected.</p>
+ <p>It is recommended to set this parameter to <c>false</c> on
+ systems with many concurrent processes, as each process memory
+ check makes a traversal of the entire list of processes.</p>
+ </item>
+ </taglist>
+ <p>See <seealso marker="kernel:config">config(4)</seealso> for
+ information about how to change the value of configuration
+ parameters.</p>
+ </section>
+ <funcs>
+ <func>
+ <name>get_memory_data() -> {Total,Allocated,Worst}</name>
+ <fsummary>Get data for the memory in the system</fsummary>
+ <type>
+ <v>Total = Allocated = int()</v>
+ <v>Worst = {Pid, PidAllocated} | undefined</v>
+ <v>&nbsp;Pid = pid()</v>
+ <v>&nbsp;PidAllocated = int()</v>
+ </type>
+ <desc>
+ <p>Returns the result of the latest memory check, where
+ <c>Total</c> is the total memory size and <c>Allocated</c>
+ the allocated memory size, in bytes.</p>
+ <p><c>Worst</c> is the pid and number of allocated bytes of
+ the largest Erlang process on the node. If <c>memsup</c>
+ should not collect process data, that is if the configuration
+ parameter <c>memsup_system_only</c> was set to <c>true</c>,
+ <c>Worst</c> is <c>undefined</c>.</p>
+ <p>The function is normally asynchronous in the sense that it
+ does not invoke a memory check, but returns the latest
+ available value. The one exception if is the function is
+ called before a first memory check is finished, in which case
+ it does not return a value until the memory check is finished.</p>
+ <p>Returns <c>{0,0,{pid(),0}}</c> or <c>{0,0,undefined}</c> if
+ <c>memsup</c> is not available, or if all memory checks so far
+ have timed out.</p>
+ </desc>
+ </func>
+ <func>
+ <name>get_system_memory_data() -> MemDataList</name>
+ <fsummary>Get system dependent memory data</fsummary>
+ <type>
+ <v>MemDataList = [{Tag, Size}]</v>
+ <v>&nbsp;Tag = atom()</v>
+ <v>&nbsp;Size = int()</v>
+ </type>
+ <desc>
+ <p>Invokes a memory check and returns the resulting, system
+ dependent, data as a list of tagged tuples, where <c>Tag</c>
+ can be one of the following:</p>
+ <taglist>
+ <tag><c>total_memory</c></tag>
+ <item>The total amount of memory available to the Erlang emulator,
+ allocated and free. May or may not be equal to the amount
+ of memory configured in the system.</item>
+ <tag><c>free_memory</c></tag>
+ <item>The amount of free memory available to the Erlang emulator
+ for allocation.</item>
+ <tag><c>system_total_memory</c></tag>
+ <item>The amount of memory available to the whole operating
+ system. This may well be equal to <c>total_memory</c> but
+ not necessarily.</item>
+ <tag><c>largest_free</c></tag>
+ <item>The size of the largest contiguous free memory block
+ available to the Erlang emulator.</item>
+ <tag><c>number_of_free</c></tag>
+ <item>The number of free blocks available to the Erlang runtime
+ system. This gives a fair indication of how fragmented
+ the memory is.</item>
+ <tag><c>buffered_memory</c></tag>
+ <item>
+ The amount of memory the system uses for temporary storing raw disk blocks.
+ </item>
+ <tag><c>cached_memory</c></tag>
+ <item>
+ The amount of memory the system uses for cached files read from disk.
+ </item>
+ <tag><c>total_swap</c></tag>
+ <item>
+ The amount of total amount of memory the system has available
+ for disk swap.
+ </item>
+ <tag><c>free_swap</c></tag>
+ <item>
+ The amount of memory the system has available for disk swap.
+ </item>
+
+ </taglist>
+ <p>All memory sizes are presented as number of <em>bytes</em>.</p>
+ <p>The <c>largest_free</c> and <c>number_of_free</c> tags are
+ currently only returned on a VxWorks system.</p>
+ <p>Returns the empty list [] if <c>memsup</c> is not available,
+ or if the memory check times out.</p>
+ <note><p>
+ On linux the memory available to the emulator is <c>cached_memory</c> and <c>buffered_memory</c> in addition to
+ <c>free_memory</c>.</p>
+ </note>
+ </desc>
+ </func>
+ <func>
+ <name>get_os_wordsize() -> Wordsize</name>
+ <fsummary>Get the wordsize of running os.</fsummary>
+ <type>
+ <v>Wordsize = 32 | 64 | unsupported_os</v>
+ </type>
+ <desc>
+ <p>Returns the wordsize of the current running operating system. </p>
+ </desc>
+ </func>
+ <func>
+ <name>get_check_interval() -> MS</name>
+ <fsummary>Get time interval, in milliseconds, for the periodic memory check</fsummary>
+ <type>
+ <v>MS = int()</v>
+ </type>
+ <desc>
+ <p>Returns the time interval, in milliseconds, for the periodic
+ memory check.</p>
+ </desc>
+ </func>
+ <func>
+ <name>set_check_interval(Minutes) -> ok</name>
+ <fsummary>Set time interval, in minutes, for the periodic memory check</fsummary>
+ <type>
+ <v>Minutes = int()>0</v>
+ </type>
+ <desc>
+ <p>Changes the time interval, given in minutes, for the periodic
+ memory check.</p>
+ <p>The change will take effect after the next memory check and is
+ non-persistent. That is, in case of a process restart, this
+ value is forgotten and the default value will be used. See
+ <seealso marker="#config">Configuration</seealso> above.</p>
+ </desc>
+ </func>
+ <func>
+ <name>get_procmem_high_watermark() -> int()</name>
+ <fsummary>Get threshold, in percent, for process memory allocation</fsummary>
+ <desc>
+ <p>Returns the threshold, in percent, for process memory
+ allocation.</p>
+ </desc>
+ </func>
+ <func>
+ <name>set_procmem_high_watermark(Float) -> ok</name>
+ <fsummary>Set threshold, as percentage represented by a float, for process memory allocation</fsummary>
+ <desc>
+ <p>Changes the threshold, given as a float, for process memory
+ allocation.</p>
+ <p>The change will take effect during the next periodic memory
+ check and is non-persistent. That is, in case of a process
+ restart, this value is forgotten and the default value will be
+ used. See <seealso marker="#config">Configuration</seealso>
+ above.</p>
+ </desc>
+ </func>
+ <func>
+ <name>get_sysmem_high_watermark() -> int()</name>
+ <fsummary>Get threshold, in percent, for system memory allocation</fsummary>
+ <desc>
+ <p>Returns the threshold, in percent, for system memory
+ allocation.</p>
+ </desc>
+ </func>
+ <func>
+ <name>set_sysmem_high_watermark(Float) -> ok</name>
+ <fsummary>Set threshold, given as a float, for system memory allocation</fsummary>
+ <desc>
+ <p>Changes the threshold, given as a float, for system memory
+ allocation.</p>
+ <p>The change will take effect during the next periodic memory
+ check and is non-persistent. That is, in case of a process
+ restart, this value is forgotten and the default value will be
+ used. See <seealso marker="#config">Configuration</seealso>
+ above.</p>
+ </desc>
+ </func>
+ <func>
+ <name>get_helper_timeout() -> Seconds</name>
+ <fsummary>Get the timeout value, in seconds, for memory checks</fsummary>
+ <type>
+ <v>Seconds = int()</v>
+ </type>
+ <desc>
+ <p>Returns the timeout value, in seconds, for memory checks.</p>
+ </desc>
+ </func>
+ <func>
+ <name>set_helper_timeout(Seconds) -> ok</name>
+ <fsummary>Set the timeout value, in seconds, for memory checks</fsummary>
+ <type>
+ <v>Seconds = int() (>= 1)</v>
+ </type>
+ <desc>
+ <p>Changes the timeout value, given in seconds, for memory
+ checks.</p>
+ <p>The change will take effect for the next memory check and is
+ non-persistent. That is, in the case of a process restart, this
+ value is forgotten and the default value will be used. See
+ <seealso marker="#config">Configuration</seealso> above.</p>
+ </desc>
+ </func>
+ </funcs>
+
+ <section>
+ <title>See Also</title>
+ <p><seealso marker="sasl:alarm_handler">alarm_handler(3)</seealso>,
+ <seealso marker="os_mon_app">os_mon(3)</seealso></p>
+ </section>
+</erlref>
+
diff --git a/lib/os_mon/doc/src/note.gif b/lib/os_mon/doc/src/note.gif
new file mode 100644
index 0000000000..6fffe30419
--- /dev/null
+++ b/lib/os_mon/doc/src/note.gif
Binary files differ
diff --git a/lib/os_mon/doc/src/notes.xml b/lib/os_mon/doc/src/notes.xml
new file mode 100644
index 0000000000..1a8551f57d
--- /dev/null
+++ b/lib/os_mon/doc/src/notes.xml
@@ -0,0 +1,537 @@
+<?xml version="1.0" encoding="latin1" ?>
+<!DOCTYPE chapter SYSTEM "chapter.dtd">
+
+<chapter>
+ <header>
+ <copyright>
+ <year>2004</year><year>2009</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ </legalnotice>
+
+ <title>OS_Mon Release Notes</title>
+ <prepared>otp_appnotes</prepared>
+ <docno>nil</docno>
+ <date>nil</date>
+ <rev>nil</rev>
+ <file>notes.xml</file>
+ </header>
+ <p>This document describes the changes made to the OS_Mon application.</p>
+
+<section><title>Os_Mon 2.2.4</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Memsup did not read memory correctly on MaxOSX
+ Snowleopard. This has now been corrected. (Thanks to Joel
+ Reymont)</p>
+ <p>
+ Own Id: OTP-8211</p>
+ </item>
+ <item>
+ <p>
+ Removed unused code in <c>cpu_sup.erl</c>.</p>
+ <p>
+ Own Id: OTP-8226</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ The documentation is now built with open source tools
+ (xsltproc and fop) that exists on most platforms. One
+ visible change is that the frames are removed.</p>
+ <p>
+ Own Id: OTP-8201</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Os_Mon 2.2.3</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ A missing define in <c>memsup.c</c> caused a build error
+ on IRIX machines. This has now been fixed.</p>
+ <p>
+ Own Id: OTP-8094</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Os_Mon 2.2.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ disksup:get_disk_data/0 returned disk volume in bytes
+ instead of kbytes as stated in the documentation. The
+ problem occurred on Windows only and is now corrected.</p>
+ <p>
+ *** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>
+ Own Id: OTP-7741</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Os_Mon 2.2.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>An error in <c>memsup</c> could cause <c>os_mon</c> to
+ report erroneous memory values on windows for ranges of
+ memory between 2GB and 4GB. This have now been fixed.</p>
+ <p>
+ Own Id: OTP-7944</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>Added support for dragonfly OS.</p>
+ <p>
+ Own Id: OTP-7938</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Os_Mon 2.2</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>The copyright notices have been updated.</p>
+ <p>
+ Own Id: OTP-7851</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Os_Mon 2.1.8</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>A problem with <c>OTP-OS-MON-MIB.mib</c> for 64-bit
+ environments has now been fixed. The mib has been
+ extended with 64-bit memory retrieval
+ counterparts.</p><p>In addition, a new function
+ <c>get_os_wordsize/0</c> has been added in the
+ <c>memsup</c> module</p>
+ <p>
+ Own Id: OTP-7441</p>
+ </item>
+ <item>
+ <p>An error in <c>memsup.c</c> caused the compilation to
+ crash on bsd environments. This has now been fixed.</p>
+ <p>
+ Own Id: OTP-7558</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Os_Mon 2.1.7</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>Fixed a build error that occurred on NetBSD (Thanks to
+ Per Hedeland and Raphael Langerhorst)</p>
+ <p>
+ Own Id: OTP-7505</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p> Memory information in
+ <c>memsup:get_system_memory_data/0</c> now has additional
+ entries in its property list for linux.</p>
+ <p>
+ Own Id: OTP-7409 Aux Id: seq10984 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Os_Mon 2.1.6</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ System information retrieval on darwin platforms with
+ environments locales not conforming to the C locale
+ caused an error in <c>cpu_sup</c> resulting in process
+ termination.</p>
+ <p>
+ Own Id: OTP-7320</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Os_Mon 2.1.5</title>
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ CPU utilization, on linux, is now measured via a port
+ program instead of os:cmd in erlang. This should enhance
+ performance.</p>
+ <p>
+ Own Id: OTP-7108 Aux Id: OTP-6935 </p>
+ </item>
+ </list>
+ </section>
+</section>
+
+ <section><title>Os_Mon 2.1.3</title>
+ <section><title>Improvements and New Features</title>
+ <list type="bulleted">
+ <item>
+ <p>
+ Extended memsup memory probing on linux to use a port
+ program to probe memory usage. This is faster then the
+ previous implementation.</p>
+ <p>
+ Own Id: OTP-6860 Aux Id: seq10616 </p>
+ </item>
+ </list>
+ </section>
+ </section>
+
+
+ <section>
+ <title>Os_Mon 2.1.2.1</title>
+
+ <section>
+ <title>Improvements and New Features</title>
+ <list type="bulleted">
+ <item>
+ <p>Minor Makefile changes.</p>
+ <p>Own Id: OTP-6689</p>
+ </item>
+ </list>
+ </section>
+ </section>
+
+ <section>
+ <title>OS_Mon 2.1.2</title>
+
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
+ <list type="bulleted">
+ <item>
+ <p>When the <c>memsup_system_only</c> flag was set to
+ <c>true</c>, a <c>badmatch</c> exception occurred in the
+ function <c>os_mon_mib:get_load/1</c>.</p>
+ <p>Own Id: OTP-6351 Aux Id: seq10517</p>
+ </item>
+ </list>
+ </section>
+ </section>
+
+ <section>
+ <title>OS_Mon 2.1.1</title>
+
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
+ <list type="bulleted">
+ <item>
+ <p>Did not build on Mac OS X.</p>
+ <p>Added support for IRIX. (Thanks to Michel Urvoy and
+ Daniel Solaz.)</p>
+ <p>Own Id: OTP-6136</p>
+ </item>
+ </list>
+ </section>
+
+ <section>
+ <title>Improvements and New Features</title>
+ <list type="bulleted">
+ <item>
+ <p><c>disksup</c>: Now using <c>round(T*100)</c> instead of
+ <c>trunc(T*100)</c> when setting the threshold value
+ given a float <c>T</c>.</p>
+ <p>Own Id: OTP-6153</p>
+ </item>
+ </list>
+ </section>
+ </section>
+
+ <section>
+ <title>Os_Mon 2.1</title>
+
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
+ <list type="bulleted">
+ <item>
+ <p>In 2.0, a call to <c>alarm_handler:get_alarms/0</c> was
+ introduced in <c>memsup</c> and <c>disksup</c>. This will
+ lead to problems if the default <c>alarm_handler</c>
+ event handler is not used, however, and the call has now
+ been removed. (Thanks to Serge Aleynikov for pointing
+ this out.)</p>
+ <p>Own Id: OTP-6029</p>
+ </item>
+ <item>
+ <p>A bug that in rare cases caused <c>cpu_sup</c> to crash
+ has been corrected.</p>
+ <p>Own Id: OTP-6102 Aux Id: seq10312 </p>
+ </item>
+ </list>
+ </section>
+ </section>
+
+ <section>
+ <title>OS_Mon 2.0</title>
+ <p>A note on backwards compatibility: The behaviour of OS_Mon 2.0 is
+ backwards compatible under normal operation, but has changed
+ somewhat in error situations: The services do not terminate
+ and the API functions do not raise exceptions in all cases where
+ they did before. Also, in the case where a service does terminate,
+ the exit reason may be different. See below for details.</p>
+
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
+ <list type="bulleted">
+ <item>
+ <p>A call to a OS_Mon service (cpu_sup, disksup, ...) when
+ OS_Mon is not running, or when the service is not
+ available for the OS, or when the service is not started,
+ will no longer result in an exception. Instead a warning
+ is issued via error_logger and a dummy value is returned,
+ which one is specified in the man pages for the
+ respective service.</p>
+ <p>The reason is that it should not be necessary for a
+ service to be started on each and every node of a
+ distributed Erlang system for the OS-MON-MIB and other
+ OS_Mon users to work properly.</p>
+ <p>Own Id: OTP-4332 Aux Id: seq7358 </p>
+ </item>
+ <item>
+ <p>References to the obsolete EVA application in
+ OTP-OS-MON-MIB has been removed.</p>
+ <p>Own Id: OTP-5699</p>
+ </item>
+ <item>
+ <p>Setting the option <c>memsup_system_only</c> to
+ <c>true</c> did not work, but would crash the
+ <c>memsup</c> process.</p>
+ <p>Own Id: OTP-5890 Aux Id: seq10185 </p>
+ </item>
+ <item>
+ <p><c>cpu_sup:nprocs/0</c> returned 0 on FreeBsd.</p>
+ <p>Own Id: OTP-5901</p>
+ </item>
+ <item>
+ <p>If the OS_Mon service <c>disksup</c> or <c>memsup</c> was
+ restarted, the same alarm could be set twice. Also, set
+ alarms were not cleared when the application was stopped.</p>
+ <p>Own Id: OTP-5910</p>
+ </item>
+ </list>
+ </section>
+
+ <section>
+ <title>Improvements and New Features</title>
+ <list type="bulleted">
+ <item>
+ <p>Thresholds and time intervals in <c>disksup</c> and
+ <c>memsup</c> are now configurable in run-time.</p>
+ <p>Own Id: OTP-4246 Aux Id: Seq7230 </p>
+ </item>
+ <item>
+ <p><c>memsup</c> can now handle systems with more than 4GB
+ of RAM.</p>
+ <p>Own Id: OTP-5800 Aux Id: seq10130 </p>
+ </item>
+ <item>
+ <p>The entire OS_Mon application (code and documentation)
+ has been reviewed and consequently updated with the goal
+ to make the application more robust, homogeneous and
+ easier to configure.</p>
+ <p>The behaviour under normal operation is backwards
+ compatible. However, recoverable errors now no longer
+ terminate the affected service (and thus possible the
+ entire application), instead <c>error_logger</c> is used
+ to warn the user if/when such errors occurs. Also, in the
+ case of unrecoverable errors, the services have been made
+ more homogeneous with respect to behavior and exit
+ reasons. See below for more information and refer to the
+ man pages for details.</p>
+ <p>Port handling has been unified, meaning that if a port
+ program sends garbage or unexpectedly dies, this is now
+ handled the same way by all OS_Mon services, namely
+ immediate process termination with the exit reason
+ <c>{port_error,Garbage}</c> or <c>{port_died,Reason}</c>,
+ respectively.</p>
+ <p>Application configuration parameter handling has been
+ unified. Bad parameter values are no longer silently
+ ignored (<c>disksup</c>) or cause application termination
+ (<c>memsup</c>, <c>os_sup</c>). Instead a warning is
+ issued and the default value for the parameter is used.
+ Also, some cases where a bad parameter value accidentally
+ could be accepted have been corrected.</p>
+ <p>Message handling has been unified. Unknown
+ (<c>gen_server-</c>) calls cause process termination,
+ whereas unknown casts and messages are now ignored by all
+ OS_Mon services.</p>
+ <p>Own Id: OTP-5897</p>
+ </item>
+ <item>
+ <p>The following changes have been made to the <c>os_sup</c>
+ service:</p>
+ <p>It is now available on Windows, using <c>nteventlog</c>
+ as backend.</p>
+ <p>On Solaris, enabling the service (that is, installing a
+ new configuration file for <c>syslogd</c> etc.) can now
+ be done outside the <c>os_sup</c> process. The reason for
+ this is that the Erlang emulator should normally not be
+ run with <c>root</c> privileges, as is otherwise
+ required. The new application configuration parameter
+ <c>os_sup_config</c> must be set to <c>false</c>.</p>
+ <p>Also, <c>os_sup</c> can now be configured using a new
+ configuration parameter <c>os_sup_mfa</c> to call an
+ arbitrary Erlang function when a message is received from
+ the OS.</p>
+ <p>Own Id: OTP-5925</p>
+ </item>
+ <item>
+ <p>The <c>memsup</c> service has been rewritten, replacing
+ the supervised <c>memsup_helper</c> with a linked help
+ process. This gives the <c>memsup</c> process more
+ control and prevents a situation where it gets out of
+ synch with the received memory data and thus possibly
+ returns erroneous results.</p>
+ <p>Own Id: OTP-5927</p>
+ </item>
+ </list>
+ </section>
+ </section>
+
+ <section>
+ <title>OS_Mon 1.8.1</title>
+
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
+ <list type="bulleted">
+ <item>
+ <p><c>cpu_sup:util/0</c> failed with error reason
+ <c>negative_diff</c> when called the first time on a
+ machine (hw) that had been up for a very long time.</p>
+ <p>Own Id: OTP-5869 Aux Id: seq10166</p>
+ </item>
+ </list>
+ </section>
+ </section>
+
+ <section>
+ <title>OS_Mon 1.8</title>
+
+ <section>
+ <title>Improvements and New Features</title>
+ <list type="bulleted">
+ <item>
+ <p>The memsup part of the OS_Mon application has been made
+ more stable. If there are (possibly temporary) problems
+ collecting memory data, the interface functions
+ (<c>get_memory_data/0</c>,
+ <c>get_system_memory_data/0</c>) now do not fail, but
+ return the previously collected value, if any, or a dummy
+ value otherwise. Also, a warning message is printed.</p>
+ <p>*** POTENTIAL INCOMPATIBILITY ***</p>
+ <p>Own Id: OTP-5798</p>
+ </item>
+ </list>
+ </section>
+ </section>
+
+ <section>
+ <title>OS_Mon 1.7.4</title>
+
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
+ <list type="bulleted">
+ <item>
+ <p>Corrected several problems in the error handling/error
+ recovery (especially when OS_Mon is starting up).</p>
+ <p>Own Id: OTP-5559</p>
+ </item>
+ </list>
+ </section>
+ </section>
+
+ <section>
+ <title>OS_Mon 1.7.3</title>
+
+ <section>
+ <title>Improvements and New Features</title>
+ <list type="bulleted">
+ <item>
+ <p><c>memsup.c</c> will now compile on OpenBSD. (Thanks to
+ Geoff White and Jay Nelson.)</p>
+ <p>The <c>disksup</c> and <c>cpu_sup</c> modules now work on
+ Mac OS X (tested on Mac OS 10.3.8).</p>
+ <p>The <c>memsup</c> module should now work on Linux 2.6.* as
+ well as on older Linuxes. (<c>/proc/meminfo</c> has
+ slightly different formats in different releases of
+ Linux.)</p>
+ <p>Own Id: OTP-5421 <br></br>
+
+ Aux Id: OTP-5194, OTP-5228, OTP-5291 </p>
+ </item>
+ </list>
+ </section>
+ </section>
+
+ <section>
+ <title>OS_Mon 1.7.2</title>
+ <p>This version is identical with 1.7.</p>
+ </section>
+</chapter>
+
diff --git a/lib/os_mon/doc/src/nteventlog.xml b/lib/os_mon/doc/src/nteventlog.xml
new file mode 100644
index 0000000000..1e3fad90cd
--- /dev/null
+++ b/lib/os_mon/doc/src/nteventlog.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="latin1" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>1998</year><year>2009</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ </legalnotice>
+
+ <title>nteventlog</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ </header>
+ <module>nteventlog</module>
+ <modulesummary>Interface to Windows Event Log</modulesummary>
+ <description>
+ <p><c>nteventlog</c> provides a generic interface to the Windows
+ event log. It is part of the OS_Mon application, see
+ <seealso marker="os_mon_app">os_mon(6)</seealso>. 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.</p>
+ <p>This module is used as the Windows backend for <c>os_sup</c>, see
+ <seealso marker="os_sup">os_sup(3)</seealso>.</p>
+ <p>To retain backwards compatibility, this module can also be used
+ to start a standalone <c>nteventlog</c> 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.</p>
+ <p>The identifier, an arbitrary string, should be reused whenever
+ the same application (or node) wants to start the process.
+ <c>nteventlog</c> 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 <c>nteventlog</c> 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).</p>
+ <p>If the event log is configured to wrap around automatically,
+ records that have arrived to the log and been overwritten when
+ <c>nteventlog</c> was not running are lost. It however detects
+ this state and loses no records that are not overwritten.</p>
+ <p>The callback function works as described in <c>os_sup(3)</c>.</p>
+ </description>
+ <funcs>
+ <func>
+ <name>start(Identifier, MFA) -> Result</name>
+ <name>start_link(Identifier, MFA) -> Result</name>
+ <fsummary>Start the NT eventlog server</fsummary>
+ <type>
+ <v>Identifier = string() | atom()</v>
+ <v>MFA = {Mod, Func, Args}</v>
+ <v>&nbsp;Mod = Func = atom()</v>
+ <v>&nbsp;Args = [term()]</v>
+ <v>Result = {ok, Pid} | {error, {already_started, Pid}}</v>
+ <v>Pid = pid()</v>
+ </type>
+ <desc>
+ <p>This function starts the standalone <c>nteventlog</c> process
+ and, if <c>start_link/2</c> is used, links to it.</p>
+ <p><c>Identifier</c> is an identifier as described above.</p>
+ <p><c>MFA</c> is the supplied callback function. When
+ <c>nteventlog</c> receives information about a new event, this
+ function will be called as <c>apply(Mod, Func, [Event|Args])</c> where <c>Event</c> is a tuple</p>
+ </desc>
+ </func>
+ <func>
+ <name>stop() -> stopped</name>
+ <fsummary>Stop the NT eventlog server</fsummary>
+ <type>
+ <v>Result = stopped</v>
+ </type>
+ <desc>
+ <p>Stops <c>nteventlog</c>. Usually only used during
+ development. The server does not have to be shut down
+ gracefully to maintain its state.</p>
+ </desc>
+ </func>
+ </funcs>
+
+ <section>
+ <title>See Also</title>
+ <p><seealso marker="os_mon_app">os_mon(6)</seealso>,
+ <seealso marker="os_sup">os_sup(3)</seealso></p>
+ <p>Windows NT documentation</p>
+ </section>
+</erlref>
+
diff --git a/lib/os_mon/doc/src/os_mon_app.xml b/lib/os_mon/doc/src/os_mon_app.xml
new file mode 100644
index 0000000000..8b44b70c5f
--- /dev/null
+++ b/lib/os_mon/doc/src/os_mon_app.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="latin1" ?>
+<!DOCTYPE appref SYSTEM "appref.dtd">
+
+<appref>
+ <header>
+ <copyright>
+ <year>1996</year><year>2009</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ </legalnotice>
+
+ <title>os_mon</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ </header>
+ <app>os_mon</app>
+ <appsummary>OS Monitoring Application</appsummary>
+ <description>
+ <p>The operating system monitor, OS_Mon, provides the following
+ services:</p>
+ <list type="bulleted">
+ <item><seealso marker="cpu_sup">cpu_sup</seealso>
+ CPU load and utilization supervision (Unix)</item>
+ <item><seealso marker="disksup">disksup</seealso>
+ Disk supervision(Unix, Windows)</item>
+ <item><seealso marker="memsup">memsup</seealso>
+ Memory supervision (Unix, Windows, VxWorks)</item>
+ <item><seealso marker="os_sup">os_sup</seealso>
+ Interface to OS system messages (Solaris, Windows)</item>
+ </list>
+ <p>To simplify usage of OS_Mon on distributed Erlang systems, it is
+ not considered an error trying to use a service at a node where it
+ is not available (either because OS_Mon is not running, or because
+ the service is not available for that OS, or because the service
+ is not started). Instead, a warning message is issued via
+ <c>error_logger</c> and a dummy value is returned, which one is
+ specified in the man pages for the respective services.</p>
+ </description>
+
+ <section>
+ <title>Configuration</title>
+ <p>When OS_Mon is started, by default all services available for
+ the OS, except <c>os_sup</c>, are automatically started. This
+ configuration can be changed using the following application
+ configuration parameters:</p>
+ <taglist>
+ <tag><c>start_cpu_sup = bool()</c></tag>
+ <item>
+ <p>Specifies if <c>cpu_sup</c> should be started. Defaults to
+ <c>true</c>.</p>
+ </item>
+ <tag><c>start_disksup = bool()</c></tag>
+ <item>
+ <p>Specifies if <c>disksup</c> should be started. Defaults to
+ <c>true</c>.</p>
+ </item>
+ <tag><c>start_memsup = bool()</c></tag>
+ <item>
+ <p>Specifies if <c>memsup</c> should be started. Defaults to
+ <c>true</c>.</p>
+ </item>
+ <tag><c>start_os_sup = bool()</c></tag>
+ <item>
+ <p>Specifies if <c>os_sup</c> should be started. Defaults to
+ <c>false</c>.</p>
+ </item>
+ </taglist>
+ <p>Configuration parameters effecting the different OS_Mon services
+ are described in the respective man pages.</p>
+ <p>See <seealso marker="kernel:config">config(4)</seealso> for
+ information about how to change the value of configuration
+ parameters.</p>
+ </section>
+
+ <section>
+ <title>SNMP MIBs</title>
+ <p>The following MIBs are defined in OS_Mon:</p>
+ <taglist>
+ <tag>OTP-OS-MON-MIB</tag>
+ <item>
+ <p>This MIB contains objects for instrumentation of disk,
+ memory and CPU usage of the nodes in the system.</p>
+ </item>
+ </taglist>
+ <p>The MIB is stored in the <c>mibs</c> directory. It is defined
+ in SNMPv2 SMI syntax. An SNMPv1 version of the MIB is delivered
+ in the <c>mibs/v1</c> directory.</p>
+ <p>The compiled MIB is located under <c>priv/mibs</c>, and
+ the generated <c>.hrl</c> file under the <c>include</c> directory.
+ To compile a MIB that IMPORTS the <c>OTP-OS-MON-MIB</c>, give
+ the option <c>{il, ["os_mon/priv/mibs"]}</c> to the MIB compiler.</p>
+ <p>If the MIB should be used in a system, it should be loaded into
+ an agent with a call to <c>os_mon_mib:load(Agent)</c>, where
+ <c>Agent</c> is the pid or registered name of an SNMP agent. Use
+ <c>os_mon_mib:unload(Agent)</c> to unload the MIB.
+ The implementation of this MIB uses Mnesia to store a cache with
+ data needed, which implicates that Mnesia must be up and running.
+ The MIB also use functions defined for the <c>OTP-MIB</c>, thus
+ that MIB must be loaded as well.</p>
+ </section>
+
+ <section>
+ <title>See Also</title>
+ <p><seealso marker="cpu_sup">cpu_sup(3)</seealso>,
+ <seealso marker="disksup">disksup(3)</seealso>,
+ <seealso marker="memsup">memsup(3)</seealso>,
+ <seealso marker="os_sup">os_sup(3)</seealso>,
+ <seealso marker="nteventlog">nteventlog(3)</seealso>,
+ <seealso marker="snmp:snmp">snmp(3)</seealso>.</p>
+ </section>
+</appref>
+
diff --git a/lib/os_mon/doc/src/os_mon_mib.xml b/lib/os_mon/doc/src/os_mon_mib.xml
new file mode 100644
index 0000000000..220d6a4a22
--- /dev/null
+++ b/lib/os_mon/doc/src/os_mon_mib.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="latin1" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2004</year><year>2009</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ </legalnotice>
+
+ <title>os_mon_mib</title>
+ <prepared>Ingela Andin</prepared>
+ <responsible></responsible>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ </header>
+ <module>os_mon_mib</module>
+ <modulesummary>Loading and Unloading of OTP-OS-MON-MIB</modulesummary>
+ <description>
+ <p>Functions for loading and unloading the OTP-OS-MON-MIB into/from
+ an SNMP agent. The instrumentation of the OTP-OS-MON-MIB uses
+ Mnesia, hence Mnesia must be started prior to loading
+ the OTP-OS-MON-MIB.</p>
+ </description>
+ <funcs>
+ <func>
+ <name>load(Agent) -> ok | {error, Reason}</name>
+ <fsummary>Load the OTP-OS-MON-MIB</fsummary>
+ <type>
+ <v>Agent = pid() | atom()</v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Loads the OTP-OS-MON-MIB.</p>
+ </desc>
+ </func>
+ <func>
+ <name>unload(Agent) -> ok | {error, Reason}</name>
+ <fsummary>Unload the OTP-OS-MON-MIB</fsummary>
+ <type>
+ <v>Agent = pid() | atom() </v>
+ <v>Reason = term()</v>
+ </type>
+ <desc>
+ <p>Unloads the OTP-OS-MON-MIB.</p>
+ </desc>
+ </func>
+ </funcs>
+
+ <section>
+ <title>See Also</title>
+ <p><seealso marker="os_mon_app">os_mon(6)</seealso>,
+ <seealso marker="snmp:snmp">snmp(3)</seealso></p>
+ </section>
+</erlref>
+
diff --git a/lib/os_mon/doc/src/os_sup.xml b/lib/os_mon/doc/src/os_sup.xml
new file mode 100644
index 0000000000..792d18ba14
--- /dev/null
+++ b/lib/os_mon/doc/src/os_sup.xml
@@ -0,0 +1,241 @@
+<?xml version="1.0" encoding="latin1" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>1996</year><year>2009</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ </legalnotice>
+
+ <title>os_sup</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ </header>
+ <module>os_sup</module>
+ <modulesummary>Interface to OS System Messages</modulesummary>
+ <description>
+ <p><c>os_sup</c> is a process providing a message passing service
+ from the operating system to the error logger in the Erlang
+ runtime system. It is part of the OS_Mon application, see
+ <seealso marker="os_mon_app">os_mon(6)</seealso>. Available for
+ Solaris and Windows.</p>
+ <p>Messages received from the operating system results in an
+ user defined callback function being called. This function can do
+ whatever filtering and formatting is necessary and then deploy any
+ type of logging suitable for the user's application.</p>
+ </description>
+
+ <section>
+ <title>Solaris Operation</title>
+ <p>The Solaris (SunOS 5.x) messages are retrieved from
+ the syslog-daemon, <c>syslogd</c>.</p>
+ <p>Enabling the service includes actions which require root
+ privileges, such as change of ownership and file privileges of an
+ executable binary file, and creating a modified copy of
+ the configuration file for <c>syslogd</c>. When <c>os_sup</c> is
+ terminated, the service must be disabled, meaning the original
+ configuration must be restored. Enabling/disabling can be done
+ either outside or inside <c>os_sup</c>, see
+ <seealso marker="#config">Configuration</seealso> below.</p>
+ <warning>
+ <p>This process cannot run in multiple instances on the same
+ hardware. OS_Mon must be configured to start <c>os_sup</c> on
+ one node only if two or more Erlang nodes execute on the same
+ machine.</p>
+ </warning>
+ <p>The format of received events is not defined.</p>
+ </section>
+
+ <section>
+ <title>Windows Operation</title>
+ <p>The Windows messages are retrieved from the eventlog file.</p>
+ <p>The <c>nteventlog</c> module is used to implement <c>os_sup</c>.
+ See <seealso marker="nteventlog">nteventlog(3)</seealso>. Note
+ that the start functions of <c>nteventlog</c> does not need to be
+ used, in this case the process is started automatically as part of
+ the OS_Mon supervision tree.</p>
+ <p>OS messages are formatted as a tuple
+ <c>{Time, Category, Facility, Severity, Message}</c>:</p>
+ <taglist>
+ <tag><c>Time = {MegaSecs, Secs, MicroSecs}</c></tag>
+ <item>
+ <p>A time stamp as returned by the BIF <c>now()</c>.</p>
+ </item>
+ <tag><c>Category = string()</c></tag>
+ <item>
+ <p>Usually one of <c>"System"</c>, <c>"Application"</c> or
+ <c>"Security"</c>. Note that the NT eventlog viewer has
+ another notion of category, which in most cases is totally
+ meaningless and therefore not imported into Erlang. What is
+ called a category here is one of the main three types of
+ events occurring in a normal NT system.</p>
+ </item>
+ <tag><c>Facility = string()</c></tag>
+ <item>
+ <p>The source of the message, usually the name of
+ the application that generated it. This could be almost any
+ string. When matching messages from certain applications,
+ the version number of the application may have to be
+ accounted for. This is what the NT event viewer calls
+ "source".</p>
+ </item>
+ <tag><c>Severity = string()</c></tag>
+ <item>
+ <p>One of <c>"Error"</c>, <c>"Warning"</c>,
+ <c>"Informational"</c>, <c>"Audit_Success"</c>,
+ <c>"Audit_Faulure"</c> or, in case of a currently unknown
+ Windows NT version <c>"Severity_Unknown"</c>.</p>
+ </item>
+ <tag><c>Message = string()</c></tag>
+ <item>
+ <p>Formatted exactly as it would be in the NT eventlog viewer.
+ Binary data is not imported into Erlang.</p>
+ </item>
+ </taglist>
+ </section>
+
+ <section>
+ <marker id="config"></marker>
+ <title>Configuration</title>
+ <taglist>
+ <tag><c>os_sup_mfa = {Module, Function, Args}</c></tag>
+ <item>
+ <p>The callback function to use. <c>Module</c> and
+ <c>Function</c> are atoms and <c>Args</c> is a list of terms.
+ When an OS message <c>Msg</c> is received, this function is
+ called as <c>apply(Module, Function, [Msg | Args])</c>.</p>
+ <p>Default is <c>{os_sup, error_report, [Tag]}</c> which will
+ send the event to the error logger using
+ <seealso marker="kernel:error_logger#error_report/2">error_logger:error_report(Tag, Msg)</seealso>. <c>Tag</c> is the value of
+ <c>os_sup_errortag</c>, see below.</p>
+ </item>
+ <tag><c>os_sup_errortag = atom()</c></tag>
+ <item>
+ <p>This parameter defines the error report type used when
+ messages are sent to error logger using the default callback
+ function. Default is <c>std_error</c>, which means the events
+ are handled by the standard event handler.</p>
+ </item>
+ <tag><c>os_sup_enable = bool()</c></tag>
+ <item>
+ <p>Solaris only. Defines if the service should be enabled (and
+ disabled) inside (<c>true</c>) or outside (<c>false</c>)
+ <c>os_sup</c>. For backwards compatibility reasons,
+ the default is <c>true</c>. The recommended value is
+ <c>false</c>, as the Erlang emulator should normally not be
+ run with <c>root</c> privileges, as is required for enabling
+ the service.</p>
+ </item>
+ <tag><c>os_sup_own = string()</c></tag>
+ <item>
+ <p>Solaris only. Defines the directory which contains
+ the backup copy and the Erlang specific configuration files
+ for <c>syslogd</c>, and a named pipe to receive the messages
+ from <c>syslogd</c>. Default is <c>"/etc"</c>.</p>
+ </item>
+ <tag><c>os_sup_syslogconf = string()</c></tag>
+ <item>
+ <p>Solaris only. Defines the full name of the configuration file
+ for <c>syslogd</c>. Default is <c>"/etc/syslog.conf"</c>.</p>
+ </item>
+ </taglist>
+ </section>
+ <funcs>
+ <func>
+ <name>enable() -> ok | {error, Res}</name>
+ <name>enable(Dir, Conf) -> ok | {error, Error}</name>
+ <fsummary>Enable the service (Solaris only)</fsummary>
+ <type>
+ <v>Dir = Conf = Res = string()</v>
+ </type>
+ <desc>
+ <p>Enables the <c>os_sup</c> service. Needed on Solaris only.</p>
+ <p>If the configuration parameter <c>os_sup_enable</c> is
+ <c>false</c>, this function is called automatically by
+ <c>os_sup</c>, using the values of <c>os_sup_own</c> and
+ <c>os_sup_syslogconf</c> as arguments.</p>
+ <p>If <c>os_sup_enable</c> is <c>true</c>, this function must
+ be called <em>before</em> OS_Mon/<c>os_sup</c> is started.
+ <c>Dir</c> defines the directory which contains the backup
+ copy and the Erlang specific configuration files for
+ <c>syslogd</c>, and a named pipe to receive the messages
+ from <c>syslogd</c>. Defaults to <c>"/etc"</c>. <c>Conf</c>
+ defines the full name of the configuration file for
+ <c>syslogd</c>. Default is <c>"/etc/syslog.conf"</c>.</p>
+ <p>Results in a OS call to:</p>
+ <code type="none"><![CDATA[
+<PRIVDIR>/bin/mod_syslog otp Dir Conf
+ ]]></code>
+ <p>where <c><![CDATA[<PRIVDIR>]]></c> is the <c>priv</c> directory of
+ OS_Mon, <c>code:priv_dir(os_mon)</c>.</p>
+ <p>Returns <c>ok</c> if this yields the expected result
+ <c>"0"</c>, and <c>{error, Res}</c> if it yields anything
+ else.</p>
+ <note>
+ <p>This function requires root privileges to succeed.</p>
+ </note>
+ </desc>
+ </func>
+ <func>
+ <name>disable() -> ok | {error, Res}</name>
+ <name>disable(Dir, Conf) -> ok | {error, Error}</name>
+ <fsummary>Disable the service (Solaris only)</fsummary>
+ <type>
+ <v>Dir = Conf = Res = string()</v>
+ </type>
+ <desc>
+ <p>Disables the <c>os_sup</c> service. Needed on Solaris only.</p>
+ <p>If the configuration parameter <c>os_sup_enable</c> is
+ <c>false</c>, this function is called automatically by
+ <c>os_sup</c>, using the same arguments as when
+ <c>enable/2</c> was called.</p>
+ <p>If <c>os_sup_enable</c> is <c>true</c>, this function must
+ be called <em>after</em> OS_Mon/<c>os_sup</c> is stopped.
+ <c>Dir</c> defines the directory which contains the backup
+ copy and the Erlang specific configuration files for
+ <c>syslogd</c>, and a named pipe to receive the messages
+ from <c>syslogd</c>. Defaults to <c>"/etc"</c>. <c>Conf</c>
+ defines the full name of the configuration file for
+ <c>syslogd</c>. Default is <c>"/etc/syslog.conf"</c>.</p>
+ <p>Results in a OS call to:</p>
+ <code type="none"><![CDATA[
+<PRIVDIR>/bin/mod_syslog nootp Dir Conf
+ ]]></code>
+ <p>where <c><![CDATA[<PRIVDIR>]]></c> is the <c>priv</c> directory of
+ OS_Mon, <c>code:priv_dir(os_mon)</c>.</p>
+ <p>Returns <c>ok</c> if this yields the expected result
+ <c>"0"</c>, and <c>{error, Res}</c> if it yields anything
+ else.</p>
+ <note>
+ <p>This function requires root privileges to succeed.</p>
+ </note>
+ </desc>
+ </func>
+ </funcs>
+
+ <section>
+ <title>See also</title>
+ <p><seealso marker="kernel:error_logger">error_logger(3)</seealso>,
+ <seealso marker="os_mon_app">os_mon(3)</seealso></p>
+ <p><c>syslogd(1M)</c>, <c>syslog.conf(4)</c> in the Solaris
+ documentation.</p>
+ <p></p>
+ </section>
+</erlref>
+
diff --git a/lib/os_mon/doc/src/part_notes.xml b/lib/os_mon/doc/src/part_notes.xml
new file mode 100644
index 0000000000..8fe226f53e
--- /dev/null
+++ b/lib/os_mon/doc/src/part_notes.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="latin1" ?>
+<!DOCTYPE part SYSTEM "part.dtd">
+
+<part xmlns:xi="http://www.w3.org/2001/XInclude">
+ <header>
+ <copyright>
+ <year>2004</year><year>2009</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ </legalnotice>
+
+ <title>OS_Mon Release Notes</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ </header>
+ <description>
+ <p>The operating system monitor, OS_Mon, provides services for
+ monitoring CPU load, disk usage, memory usage and OS messages.</p>
+ </description>
+ <xi:include href="notes.xml"/>
+</part>
+
diff --git a/lib/os_mon/doc/src/ref_man.xml b/lib/os_mon/doc/src/ref_man.xml
new file mode 100644
index 0000000000..5a50c122fd
--- /dev/null
+++ b/lib/os_mon/doc/src/ref_man.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="latin1" ?>
+<!DOCTYPE application SYSTEM "application.dtd">
+
+<application xmlns:xi="http://www.w3.org/2001/XInclude">
+ <header>
+ <copyright>
+ <year>1996</year><year>2009</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ </legalnotice>
+
+ <title>OS_Mon Reference Manual</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ </header>
+ <description>
+ <p>The operating system monitor, OS_Mon, provides services for
+ monitoring CPU load, disk usage, memory usage and OS messages.</p>
+ </description>
+ <xi:include href="os_mon_app.xml"/>
+ <xi:include href="cpu_sup.xml"/>
+ <xi:include href="disksup.xml"/>
+ <xi:include href="memsup.xml"/>
+ <xi:include href="os_mon_mib.xml"/>
+ <xi:include href="os_sup.xml"/>
+ <xi:include href="nteventlog.xml"/>
+</application>
+
diff --git a/lib/os_mon/doc/src/user_guide.gif b/lib/os_mon/doc/src/user_guide.gif
new file mode 100644
index 0000000000..e6275a803d
--- /dev/null
+++ b/lib/os_mon/doc/src/user_guide.gif
Binary files differ
diff --git a/lib/os_mon/doc/src/warning.gif b/lib/os_mon/doc/src/warning.gif
new file mode 100644
index 0000000000..96af52360e
--- /dev/null
+++ b/lib/os_mon/doc/src/warning.gif
Binary files differ