How to setup Nagios service to monitor Weblogic server using wlsagent plugin

396 views
Skip to first unread message

Chun

unread,
Apr 16, 2014, 2:15:35 PM4/16/14
to wlsa...@googlegroups.com
Can someone tell me how to setup Nagios service to monitor memory usage using wlsagent plugin?  I am a new Nagios user but this is related to using the plugin.

I followed https://code.google.com/p/wlsagent/wiki/Wlsagent to install wlsagent on target server and can run wget in command line:

wget -O - -q http://targetserver:9090/wlsagent/WlsAgent --post-data='hostname=host&port=9000&username=nagios&password=password&jvm=UsedMemory,80,90'
0|MangedServer is in RUNNING state, status OK|HeapSize=571MB;;;0;1820 UsedMemory=358MB;;;0;1820

But the following Nagios definitions give me "wget: missing URL" in Nagios web interface:

define command{
        command_name wget
        command_line /usr/bin/wget
}
define service{
    use                             generic-service
    host_name                       host.mydomain
    service_description             MEMORY
    check_command wget!-q -O - 'http://targetserver:9090/wlsagent/WlsAgent --post-data='hostname=host&port=9000&username=nagios&password=password&jvm=UsedMemory,80,90'
}

Chun

unread,
Apr 23, 2014, 5:55:41 PM4/23/14
to wlsa...@googlegroups.com
I found the answer :> This is part of the Nagios learning curve.
The plugin comes with the shell script wlsagent.sh which wraps up the wget command.
I copied the script to nagios/libexec directory. The following definitions look good in Nagios to monitor Weblogic server at port 9000.

# The 1st number after UsedMemory is warning threshold (%) for JVM heap usage; the 2nd number is critical threshold.
# These values are compared to the UsedMemory / HeapSizeMax ratio
define command{
        command_name check_wls_memory
        command_line $USER1$/wlsagent.sh 'hostname=$HOSTADDRESS$&port=$ARG1$&username=nagios&password=nagios&jvm=UsedMemory,80,90'

define service{
    use                                   generic-service
    host_name                       myhost.com
    service_description          MEMORY USE
    check_command              check_wls_memory!9000
    notification_interval          1440
Reply all
Reply to author
Forward
0 new messages