Monitoring Long process names on Solaris

Charles Bueche charles at bueche.ch
Wed Mar 17 07:44:06 CET 2004


Hi,

well, for some things, you have no choice. We do it that way (not in
Nagios) to check for processes that must run and have ugly long names
(eg WLS instances). The right way is to run it once every 5 minutes and
look for all processes you want (not running /usr/ucb/ps auxwww | grep
pname for each process).

Now, if you step back a bit, reconsider what is the better way to
check for something (here, syslogd as exemple) :

- a syslogd process is present, but you don't know if it still does what
you want it to do
- events sent using "logger" appear to /var/log/monitor (you will need a
crafted syslog.conf for this, and a log parser that run from some agent
and check for a recent entry in /var/log/monitor).

IMHO, it's almost always better to check for functionality of the
service you want instead of the presence of some process in the process
table. Now, I admit that it is more difficult, but you catch what you
really want : the service you sold to your customers is up or down.

Having worked in monitoring (net, systems, services) for a few years, I
think checking for the service is almost always better.

Charles


On Tue, 16 Mar 2004 17:52:15 -0500 (EST)
Subhendu Ghosh <sghosh at sghosh.org> wrote:

> If /usr/ucb/bin/ps auxwww uses a lot of resources - would you want to
> run it every 5 min as a normal plugin?
> 
> On Tue, 16 Mar 2004, Charles Bueche wrote:
> 
> > Hi,
> > 
> > On Solaris, the process table is broken, the names are shortened.
> > The only way to get the full command names is to parse /proc/PIDs.
> > Luckily, there is another ps version that does this well :
> > 
> > 	/usr/ucb/ps auxwww
> > 
> > Now, be sure to avoid calling this command too much, it takes a lot
> > of time and is heavy on the system.
> > 
> > You will need to adjust your plugin accordingly.
> > 
> > Regs,
> > Charles
> > 
> > On Tue, 16 Mar 2004 10:44:30 -0600
> > "Jeffery P. Humes" <jeff at bofus.org> wrote:
> > 
> > > I am pretty new to the nagios scene. I am trying to monitor long
> > > named processes on Solaris 8.
> > > 
> > > I can monitor processes with the "check_procs" plugin:
> > > 
> > > ------
> > > check_procs -c 1:1 -C 
> > > "/opt/bea/jdk131_08/bin/../bin/sparc/native_threads/java" -a
> > > -ms384m
> > > 
> > > OK - 1 processes running with command name 
> > > /opt/bea/jdk131_08/bin/../bin/sparc/native_threads/java, args
> > > -ms384m------
> > > 
> > > This works fine.
> > > 
> > > However, I run into a problem with processes that have very long
> > > names and the name I want to watch is near the end of the string.
> > > 
> > > example:
> > > bea      28402  0.2 20.6581704102648 ?        S   Mar 03 1050:18 
> > > /opt/bea/jdk131_08/bin/../bin/sparc/native_threads/java -ms384m
> > > -mx384m -Xrs -XX:MaxPermSize=128M -XX:MaxNewSize=128M
> > > -XX:SurvivorRatio=8 -Xrs
> > > -Dcommerce.properties=/opt/bea/weblogic7/portal/weblogiccommerce.
> > > prop erties -Dejbruntime.appserver=weblogic61
> > > -Dejbruntime.config=weblogicportal40
> > > -Dejbruntime.database=oracle817thin
> > > -Dcom.compoze.home=/opt/ti_apps/portal/educationDomain/lib/ext/co
> > > mpoze-classpath 
> > > /opt/ti_apps/portal/educationDomain/lib/ext/classes12.zip:/opt/ti
> > > _app
> > > s/portal/educationDomain/settings:/opt/ti_apps/portal/educationDo
> > > main/lib/ext/autonomyClient.jar:/opt/ti_apps/portal/educationDoma
> > > in/lib/s
> > > tartup/startup.jar:/opt/ti_apps/portal/educationDomain/lib/ext/ad
> > > c.ja
> > > r:/opt/ti_apps/portal/educationDomain/lib/ext/Utilities.jar:/opt/
> > > ti_a
> > > pps/portal/educationDomain/lib/ext/struts.jar:/opt/ti_apps/portal
> > > /edu
> > > cationDomain/lib/ext/commons-fileupload.jar:/opt/ti_apps/portal/e
> > > duca
> > > tionDomain/lib/ext/jakarta-regexp-1.2.jar:/opt/ti_apps/portal/edu
> > > cati
> > > onDomain/lib/ext/log4j-1.2.8.jar:/opt/ti_apps/portal/educationDom
> > > ain/
> > > settings/compoze/license:/opt/ti_apps/portal/educationDomain/lib/
> > > ext/
> > > oro-2.0.4/oro-2.0.4.jar:/opt/ti_apps/portal/educationDomain/lib/e
> > > xt/c
> > > ompoze/security.jar:/opt/ti_apps/portal/educationDomain/lib/ext/c
> > > ompo
> > > ze/csdk.jar:/opt/ti_apps/portal/educationDomain/lib/ext/compoze/j
> > > 2ee_
> > > runtime.jar:/opt/ti_apps/portal/educationDomain/lib/ext/compoze/d
> > > iscu
> > > ssion.jar:/opt/bea/weblogic7/server/lib/weblogic.jar:/opt/bea/web
> > > logi
> > > c7/server/lib/webservices.jar:/opt/bea/weblogic7/portal/lib/p13n_
> > > syst
> > > em.jar:/opt/bea/weblogic7/portal/lib/ext/jdom.jar:/opt/bea/weblog
> > > ic7/
> > > portal/lib/ext/HTTPClient.jar:/opt/bea/weblogic7/portal/lib/ext/w
> > > lcsp
> > > arsers.jar:/opt/bea/weblogic7/portal/lib/commerce_system.jar:/opt
> > > /bea/weblogic7/portal/lib/campaign_system.jar:/opt/bea/weblogic7/
> > > server/l
> > > ib/jdom.jar:/opt/bea/weblogic7/portal/lib/portal_system.jar:/opt/
> > > bea/
> > > jdk131_08/lib/tools.jar:/opt/bea:/opt/bea/weblogic7/portal/lib/co
> > > mmer
> > > ce_system.jar:/opt/bea/weblogic7/portal/lib/campaign_system.jar-D
> > > weblogic.Name=portal_ms1
> > > -Dbea.home=/opt/bea-Dweblogic.management.username=
> > > -Dweblogic.management.password=-Dweblogic.management.server=http:
> > > //ncapp10.eps.ti.com:9501-Dweblogic.ProductionModeEnabled=true
> > > -Djava.security.policy=/opt/bea/weblogic7/server/lib/weblogic.pol
> > > icy weblogic.Server
> > > 
> > > 
> > > I believe that the problem is the "ps" command that is called only
> > > show partial process strings.
> > > 
> > > How can I either:
> > > 1. get the check_procs command to use "/usr/ucb/ps auxww" instead
> > > of "/usr/bin/ps"?
> > > 2. find some other way to monitor processes by name?
> > > 
> > > Thanks for any assistance.
> > > 
> > > -Jeff Humes
> > > 
> 
> -- 
> 


-- 
Charles Bueche <charles at bueche.ch>
sand, snow, wave, wind and net -surfer


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list