Monitoring Long process names on Solaris

Subhendu Ghosh sghosh at sghosh.org
Tue Mar 16 23:52:15 CET 2004


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/compoze
> > -classpath 
> > /opt/ti_apps/portal/educationDomain/lib/ext/classes12.zip:/opt/ti_app
> > s/portal/educationDomain/settings:/opt/ti_apps/portal/educationDomain
> > /lib/ext/autonomyClient.jar:/opt/ti_apps/portal/educationDomain/lib/s
> > tartup/startup.jar:/opt/ti_apps/portal/educationDomain/lib/ext/adc.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/educa
> > tionDomain/lib/ext/jakarta-regexp-1.2.jar:/opt/ti_apps/portal/educati
> > onDomain/lib/ext/log4j-1.2.8.jar:/opt/ti_apps/portal/educationDomain/
> > 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/ext/c
> > ompoze/security.jar:/opt/ti_apps/portal/educationDomain/lib/ext/compo
> > ze/csdk.jar:/opt/ti_apps/portal/educationDomain/lib/ext/compoze/j2ee_
> > runtime.jar:/opt/ti_apps/portal/educationDomain/lib/ext/compoze/discu
> > ssion.jar:/opt/bea/weblogic7/server/lib/weblogic.jar:/opt/bea/weblogi
> > c7/server/lib/webservices.jar:/opt/bea/weblogic7/portal/lib/p13n_syst
> > em.jar:/opt/bea/weblogic7/portal/lib/ext/jdom.jar:/opt/bea/weblogic7/
> > portal/lib/ext/HTTPClient.jar:/opt/bea/weblogic7/portal/lib/ext/wlcsp
> > 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/commer
> > ce_system.jar:/opt/bea/weblogic7/portal/lib/campaign_system.jar
> > -Dweblogic.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.policy
> > 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
> > 

-- 




-------------------------------------------------------
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