Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

os_mon(7) [linux man page]

os_mon(7)						   Erlang Application Definition						 os_mon(7)

NAME
os_mon - OS Monitoring Application DESCRIPTION
The operating system monitor, OS_Mon, provides the following services: * cpu_sup CPU load and utilization supervision (Unix) * disksup Disk supervision(Unix, Windows) * memsup Memory supervision (Unix, Windows, VxWorks) * os_sup Interface to OS system messages (Solaris, Windows) 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 error_logger and a dummy value is returned, which one is specified in the man pages for the respective services. CONFIGURATION
When OS_Mon is started, by default all services available for the OS, except os_sup , are automatically started. This configuration can be changed using the following application configuration parameters: start_cpu_sup = bool() : Specifies if cpu_sup should be started. Defaults to true . start_disksup = bool() : Specifies if disksup should be started. Defaults to true . start_memsup = bool() : Specifies if memsup should be started. Defaults to true . start_os_sup = bool() : Specifies if os_sup should be started. Defaults to false . Configuration parameters effecting the different OS_Mon services are described in the respective man pages. See config(5) for information about how to change the value of configuration parameters. SNMP MIBS
The following MIBs are defined in OS_Mon: OTP-OS-MON-MIB : This MIB contains objects for instrumentation of disk, memory and CPU usage of the nodes in the system. The MIB is stored in the mibs directory. It is defined in SNMPv2 SMI syntax. An SNMPv1 version of the MIB is delivered in the mibs/v1 directory. The compiled MIB is located under priv/mibs , and the generated .hrl file under the include directory. To compile a MIB that IMPORTS the OTP-OS-MON-MIB , give the option {il, ["os_mon/priv/mibs"]} to the MIB compiler. If the MIB should be used in a system, it should be loaded into an agent with a call to os_mon_mib:load(Agent) , where Agent is the pid or registered name of an SNMP agent. Use os_mon_mib:unload(Agent) 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 OTP-MIB , thus that MIB must be loaded as well. SEE ALSO
cpu_sup(3erl) , disksup(3erl) , memsup(3erl) , os_sup(3erl) , nteventlog(3erl) , snmp(3erl) . Ericsson AB os_mon 2.2.5 os_mon(7)

Check Out this Related Man Page

os_sup(3erl)						     Erlang Module Definition						      os_sup(3erl)

NAME
os_sup - Interface to OS System Messages DESCRIPTION
os_sup 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 os_mon(7) . Available for Solaris and Windows. Messages received from the operating system results in an user defined callback function being called. This function can do whatever fil- tering and formatting is necessary and then deploy any type of logging suitable for the user's application. SOLARIS OPERATION
The Solaris (SunOS 5.x) messages are retrieved from the syslog-daemon, syslogd . 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 syslogd . When os_sup is terminated, the service must be disabled, meaning the original configuration must be restored. Enabling/disabling can be done either outside or inside os_sup , see Configuration below. Warning: This process cannot run in multiple instances on the same hardware. OS_Mon must be configured to start os_sup on one node only if two or more Erlang nodes execute on the same machine. The format of received events is not defined. WINDOWS OPERATION
The Windows messages are retrieved from the eventlog file. The nteventlog module is used to implement os_sup . See nteventlog(3erl) . Note that the start functions of nteventlog does not need to be used, in this case the process is started automatically as part of the OS_Mon supervision tree. OS messages are formatted as a tuple {Time, Category, Facility, Severity, Message} : Time = {MegaSecs, Secs, MicroSecs} : A time stamp as returned by the BIF now() . Category = string() : Usually one of "System" , "Application" or "Security" . 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. Facility = string() : The source of the message, usually the name of the application that generated it. This could be almost any string. When matching mes- sages from certain applications, the version number of the application may have to be accounted for. This is what the NT event viewer calls "source". Severity = string() : One of "Error" , "Warning" , "Informational" , "Audit_Success" , "Audit_Faulure" or, in case of a currently unknown Windows NT version "Severity_Unknown" . Message = string() : Formatted exactly as it would be in the NT eventlog viewer. Binary data is not imported into Erlang. CONFIGURATION
os_sup_mfa = {Module, Function, Args} : The callback function to use. Module and Function are atoms and Args is a list of terms. When an OS message Msg is received, this func- tion is called as apply(Module, Function, [Msg | Args]) . Default is {os_sup, error_report, [Tag]} which will send the event to the error logger using error_logger:error_report(Tag, Msg) . Tag is the value of os_sup_errortag , see below. os_sup_errortag = atom() : This parameter defines the error report type used when messages are sent to error logger using the default callback function. Default is std_error , which means the events are handled by the standard event handler. os_sup_enable = bool() : Solaris only. Defines if the service should be enabled (and disabled) inside ( true ) or outside ( false ) os_sup . For backwards com- patibility reasons, the default is true . The recommended value is false , as the Erlang emulator should normally not be run with root privileges, as is required for enabling the service. os_sup_own = string() : Solaris only. Defines the directory which contains the backup copy and the Erlang specific configuration files for syslogd , and a named pipe to receive the messages from syslogd . Default is "/etc" . os_sup_syslogconf = string() : Solaris only. Defines the full name of the configuration file for syslogd . Default is "/etc/syslog.conf" . EXPORTS
enable() -> ok | {error, Res} enable(Dir, Conf) -> ok | {error, Error} Types Dir = Conf = Res = string() Enables the os_sup service. Needed on Solaris only. If the configuration parameter os_sup_enable is false , this function is called automatically by os_sup , using the values of os_sup_own and os_sup_syslogconf as arguments. If os_sup_enable is true , this function must be called before OS_Mon/ os_sup is started. Dir defines the directory which contains the backup copy and the Erlang specific configuration files for syslogd , and a named pipe to receive the messages from syslogd . Defaults to "/etc" . Conf defines the full name of the configuration file for syslogd . Default is "/etc/syslog.conf" . Results in a OS call to: <PRIVDIR>/bin/mod_syslog otp Dir Conf where <PRIVDIR> is the priv directory of OS_Mon, code:priv_dir(os_mon) . Returns ok if this yields the expected result "0" , and {error, Res} if it yields anything else. Note: This function requires root privileges to succeed. disable() -> ok | {error, Res} disable(Dir, Conf) -> ok | {error, Error} Types Dir = Conf = Res = string() Disables the os_sup service. Needed on Solaris only. If the configuration parameter os_sup_enable is false , this function is called automatically by os_sup , using the same arguments as when enable/2 was called. If os_sup_enable is true , this function must be called after OS_Mon/ os_sup is stopped. Dir defines the directory which contains the backup copy and the Erlang specific configuration files for syslogd , and a named pipe to receive the messages from syslogd . Defaults to "/etc" . Conf defines the full name of the configuration file for syslogd . Default is "/etc/syslog.conf" . Results in a OS call to: <PRIVDIR>/bin/mod_syslog nootp Dir Conf where <PRIVDIR> is the priv directory of OS_Mon, code:priv_dir(os_mon) . Returns ok if this yields the expected result "0" , and {error, Res} if it yields anything else. Note: This function requires root privileges to succeed. SEE ALSO
error_logger(3erl) , os_mon(3erl) syslogd(1M) , syslog.conf(5) in the Solaris documentation. Ericsson AB os_mon 2.2.5 os_sup(3erl)
Man Page