Sponsored Content
Special Forums UNIX and Linux Applications Infrastructure Monitoring AIX monitoring tools for graphical output Post 302472059 by bakunin on Tuesday 16th of November 2010 07:00:54 AM
Old 11-16-2010
Probably your simplest option would be to write a small script.

To monitor the processes use the "ps" command, like in the following script sketch:

Code:
while : ; do
     if [ $(ps -fe | grep "<processname>" | wc -l) -le <minimum_nr_plus_1> ] ; then
          show_error "Not all processes seem to run."
     fi
     sleep <nr_of_seconds>
done

To monitor the memory is more tricky: (almost) all otherwise unused memory is used by the OS for caching purposes, so monitoring "free memory" is completely useless - you get constantly "nearly all memory used" as a result, regardless of how much memory is in fact used by applications.


If you are not interested in exact memory consumption, but only in avoiding paging you could monitor the utilization of the paging space(s) by "lsps -a":

Code:
while : ; do
     if [ $(lsps -s | sed '1d;s/^.*\([0-9][0-9]*\)%.*$/\1/') -gt <threshold_value>] ; then
          show_error "Paging space utilization exceeded."
     sleep <nr_of_seconds>
done

Tomcat is an application and could be monitored like any other process (see above)

Monitoring network connectivity is relatively easy, but with a catch: if the network connection goes down the machine has usually no way of advertising this fact. The best solution is to monitor the system from another host, like in the following sketch:

Code:
while : ; do
     if [ $(ping -c1 <host_to_monitor1>; echo $?) -gt 0 ] ; then
          show_error "Cannot reach <host_to_monitor1>"
     fi
     if [ $(ping -c1 <host_to_monitor2>; echo $?) -gt 0 ] ; then
          show_error "Cannot reach <host_to_monitor2>"
     fi
     [ ...]
     sleep <nr_of_seconds>
done

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
 

10 More Discussions You Might Find Interesting

1. IP Networking

Networking Monitoring Tools

Any idea where can I get a freware to monitor the network traffic in my department? The best is this tool can store the log files. Thanks! (5 Replies)
Discussion started by: zheng_soon
5 Replies

2. Infrastructure Monitoring

UNIX Monitoring tools

I need some monitoring tools for SCO 7.1.4 Does anybody reccomend some software that I can install to monitor mem leaks and odd SAR values etc (2 Replies)
Discussion started by: trebor1
2 Replies

3. UNIX for Advanced & Expert Users

UNIX monitoring tools

Guys, I would like to know who are using monitoring tools? I use Nagios before but it seems is more on Linux and Windows platform. - Nagios - BigBrother - BigSister - Cacti - MRTG - JFFNMS - anymore? Please give comment too I would like to have some comment on UNIX monitoring tools.... (2 Replies)
Discussion started by: dwarf007
2 Replies

4. Red Hat

Monitoring tools

Hi, In HPUX there is a grate monitor tools named GLANCE, which give you information on the disks load, memory usage, cpu ... What is the equivalent tool in LINUX Redhat 4. Thanks (3 Replies)
Discussion started by: yoavbe
3 Replies

5. AIX

AIX 4.2 temperature monitoring tools included ?

Are there any AIX 4.2 commands that would give me the ability to monitor the hardware temperature ? I did a forum search and found nothing about AIX. I checked the 'diag' command but it does not say anywhere that it has this feature. I tried the 'prtdiag' command but it does not exist on the... (6 Replies)
Discussion started by: Browser_ice
6 Replies

6. Solaris

Recommend graphical monitoring tool for sun

Hi folks I am looking for tool which have graphical presentation for cpu and disk characteristics. Cpu is the least of the concern, disk is the most. We use san devices and i know which id's correspond to it. But the problem is that at least one of the tool I tried to use - Quest Sportlight does... (6 Replies)
Discussion started by: ggolub
6 Replies

7. Infrastructure Monitoring

Monitoring tools

I am interested whitch tools are the best by monitoring the UNIX processes and network interfaces ? and whitch tools for management UNIX ? I know that the nagios very good monitoring tools, but interested me and others who have ? (4 Replies)
Discussion started by: danyy
4 Replies

8. UNIX for Dummies Questions & Answers

UNIX user monitoring tools

Hello mates.. i need help with these things *Users should be allowed to login only once, i.e Multiple logins from single user should be restricted and should issue an alert if any user tries . *statistics of everyday log in time ,duration of login,and the commands executed by the user *Alert... (6 Replies)
Discussion started by: safijunaid
6 Replies

9. Red Hat

Recommendations on GRAPHICAL Monitoring Tool

Need assistance in finding a Graphical Monitoring tool open source for Centos , REDHAT linux which doesnt require "root" to compile the tool. Tool that does performance monitoring for Disk usage, CPU, Memory ,Network stats Need install and configure steps as well . (2 Replies)
Discussion started by: ajayram_arya
2 Replies

10. AIX

Monitoring tools

The monitoring tools what we have not able to see historical information about the process name or pid number for the process that consumed high CPU or memory or paging space. Can you please suggest some of the best monitoring tools available in the market that monitors primarily AIX and other Unix... (0 Replies)
Discussion started by: baladelaware73
0 Replies
pmfadm(1M)						  System Administration Commands						pmfadm(1M)

NAME
pmfadm - process monitor facility administration SYNOPSIS
/usr/cluster/bin/pmfadm -c nametag [-a action] [ [-e ENV_VAR=env.var...] | -E] [-n retries] [-t period] [-C level#] command [args-to-command...] /usr/cluster/bin/pmfadm -k nametag [-w timeout] [signal] /usr/cluster/bin/pmfadm -L [-h host] /usr/cluster/bin/pmfadm -l nametag [-h host] /usr/cluster/bin/pmfadm -m nametag [-n retries] [-t period] /usr/cluster/bin/pmfadm -q nametag [-h host] /usr/cluster/bin/pmfadm -s nametag [-w timeout] [signal] DESCRIPTION
The pmfadm utility provides the administrative, command-line interface to the process monitor facility. The process monitor facility provides a means of monitoring processes, and their descendents, and restarting them if they fail to remain alive. The total number of failures allowed can be specified, and limited to a specific time period. After the maximum number of failures has occurred within the specified time period, a message is logged to the console, and the process is no longer restarted. If an action program has been specified, it is called when the number of failures allowed has been reached. If the action program exits with non-zero status, the process nametag is removed from the process monitor facility. Otherwise, the process is restarted with the origi- nal parameters passed into pmfadm. Processes that are started under control of the process monitor are run as the effective user ID (euid) and effective group ID (egid) of the user that initiated the request. Only the original user, or root, can manipulate the nametag associated with those processes. Status information, however, is available to any caller, local or remote. All spawned processes, and their descendent spawned processes, of the process that initially started are monitored. Only when the last process or sub-process exits does the process monitor attempt to restart the process. You can run this command in the global zone or in a non-global zone. The command affects only the global or non-global zone in which you issue the command. OPTIONS
The following options are supported: -a action The action program to be called when the process fails to stay alive. This program must be specified in a single argument to the -a option, but can be a quoted string that contains multiple components. In either case, the string is executed as specified, with two additional arguments, the event that occurred (currently only failed), and the nametag associated with the process. The current direc- tory, and PATH environment variable, are reinstantiated before the command is executed. No other environment variables are, or should be assumed to be, preserved. If the action program exits with status 0, the process is started over again with the original arguments that were given to pmfadm. Any other exit status causes the nametag to cease to exist within the scope of the process monitor. If no -a option is specified, the result is the same as if there were an action script specified which always exits non-zero. -C level# When starting a process, monitor it and its children up to and including level level#. The value of level# must be an integer greater than or equal to zero. The original process executed is at level 0, its children are executed at level 1, their children are executed at level 2, and so on. Any new fork operation produces a new level of children. This option provides more control over which processes get monitored. It is useful for monitoring servers that fork new processes. When this option is not specified, all children are monitored, and the original process is not restarted until it and all its children have died. If a server forks new processes to handle client requests, it might be desirable to monitor only the server. The server needs to be restarted if it dies even if some client processes are still running. The appropriate monitoring level is -C 0. If, after forking a child, the parent exits, then it is the child that needs monitoring. The level to use to monitor the child is -C 1. When both processes die, the server is restarted. -c nametag Start a process, with nametag as an identifier. All arguments that follow the command-line flags are executed as the process of inter- est. The current directory, and PATH environment variable, are reinstantiated by the process monitor facility before the command is executed. No other environment variables are, or should be assumed to be, preserved. If nametag already exists, pmfadm exits with exit status 1, with no side effects. I/O redirection is not supported in the command-line arguments. If this is necessary, a script should be created that performs this re- direction, and used as the command that pmfadm executes. -E Pass the whole pmfadm environment to the new process. The default is not to use this option, in which case the rpc.pmfd environment plus the path of the pmfadm environment are passed. The -e and -E options are mutually exclusive, that is, both cannot be used in the same command. -e ENV_VAR=env.value An environment variable in the form ENV_VAR=env.value which is passed to the execution environment of the new process. This option can be repeated, so multiple environment variables can be passed. The default is not to use this option, in which case the rpc.pmfd envi- ronment plus the path of the pmfadm environment are passed. -h host The name of the host to contact. Defaults to localhost. -k nametag Send the specified signal to the processes associated with nametag, including any processes associated with the action program if it is currently running. The default signal, SIGKILL, is sent if none is specified. If the process and its descendants exit, and there are remaining retries available, the process monitor restarts the process. The signal specified is the same set of names recognized by the kill command. -L Return a list of all tags running that belong to the user that issued the command, or if the user is root, all tags running on the server are shown. -l nametag Print out status information about nametag. The output from this command is useful mainly for diagnostics and might be subject to change. -m nametag Modify the number of retries, or time period over which to observe retries, for nametag. Once these parameters have been changed, the history of earlier failures is cleared. -n retries Number of retries allowed within the specified time period. The default value for this field is 0, which means that the process is not restarted once it exits. The maximum value allowed is 100. A value of -1 indicates that the number of retries is infinite. -q nametag Indicate whether nametag is registered and running under the process monitor. Returns 0 if it is, 1 if it is not. Other return values indicate an error. -s nametag Stop restarting the command associated with nametag. The signal, if specified, is sent to all processes, including the action script and its processes if they are currently executing. If a signal is not specified, none is sent. Stopping the monitoring of processes does not imply that they no longer exist. The processes remain running until they, and all of their descendents, have exited. The sig- nal specified is the same set of names recognized by the kill command. -t period Minutes over which to count failures. The default value for this flag is -1, which equates to infinity. If this parameter is specified, process failures that have occurred outside of the specified period are not counted. -w timeout When used in conjunction with the -s nametag or -k nametag flags, wait up to the specified number of seconds for the processes associ- ated with nametag to exit. If the timeout expires, pmfadm exits with exit status 2. The default value for this flag is 0, meaning that the command returns immediately without waiting for any process to exit. If a value of -1 is given, pmfadm waits indefinitely for the processes associated with the tag to exit. The pmfadm process does not release the RPC server thread that it uses until the RPC timeout period is reached. Therefore, avoid setting the -w timeout value to -1 unnecessarily. EXAMPLES
Example 1 Starting a Sleep Process That Will Not be Restarted The following example starts a sleep process named sleep.once that will not be restarted once it exits: example% pmfadm -c sleep.once /bin/sleep 5 Example 2 Starting a Sleep Process and Restarting It The following example starts a sleep process and restarts it, at most, one time: example% pmfadm -c sleep.twice -n 1 /bin/sleep 5 Example 3 Starting a Sleep Process and Restarting It The following examples start a sleep process and restarts it, at most, twice per minute. It calls /bin/true when it fails to remain running beyond the acceptable number of failures: example% pmfadm -c sleep.forever -n 2 -t 1 -a /bin/true /bin/sleep 60 Example 4 Listing the Current Status of the sleep.forever Nametag The following command lists the current status of the sleep.forever nametag: example% pmfadm -l sleep.forever Example 5 Sending a SIGHUP to All Processes The following command sends a SIGHUP to all processes associated with sleep.forever, waiting up to five seconds for all processes to exit. example% pmfadm -w 5 -k sleep.forever HUP Example 6 Stopping the Monitoring of Processes and Sending a SIGHUP The following command stops monitoring (restarting) processes associated with sleep.forever, and sends a SIGHUP to any processes related to it. This command returns as soon as the signals have been delivered, but possibly before all processes have exited. example% pmfadm -s sleep.forever HUP Example 7 Listing All Tags Running That Belong to the User If a user issues the following commands: example% pmfadm -c sleep.once /bin/sleep 30 example% pmfadm -c sleep.twice /bin/sleep 60 example% pmfadm -c sleep.forever /bin/sleep 90 the output of the following command: example% pmfadm -L is sleep.once sleep.twice sleep.forever EXIT STATUS
The following exit values are returned: 0 Successful completion. 1 nametag doesn't exist, or there was an attempt to create a nametag that already exists. 2 The command timed out. other nonzero An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
kill(1), truss(1), rpc.pmfd(1M), attributes(5) NOTES
To avoid collisions with other controlling processes. The truss command does not allow tracing a process that it detects as being con- trolled by another process by way of the /proc interface. Because the rpc.pmfd daemon prior to Solaris 10 OS uses the /proc interface to monitor processes and their descendants, those processes that are submitted to rpc.pmfd by way of the pmfadm command cannot be traced or debugged. As of the Solaris 10 OS release, this restriction no longer applies. Sun Cluster 3.2 13 Aug 2007 pmfadm(1M)
All times are GMT -4. The time now is 12:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy