LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Nagios Plugin [.sh] not working (http://www.linuxquestions.org/questions/linux-server-73/nagios-plugin-%5B-sh%5D-not-working-4175451747/)

sunnysthakur 02-26-2013 07:23 AM

Nagios Plugin [.sh] not working
 
Hello.

I am working on setup a nagios plugin for monitor tomcat instance from tomcat manager.

This is a script file downloaded from
PHP Code:

http://exchange.nagios.org/directory/Plugins/Java-Applications-and-Servers/Apache-Tomcat/check_TomcatApplication/details 

This is working fine when executed as shell by passing variables

PHP Code:

[root@monitor ~]# ./check_TomcatApplication --user admin --password password --host 192.168.11.15 --port 8080 --appname DEMO_32

OKApplication DEMO_32 is running

Now when i configured this as a nagios command in command.cfg this is not working.

PHP Code:

define command{
       
command_name check_TomcatApplication
       command_line $USER1
$/check_TomcatApplication --user $USER13$ --password $USER14$ --host $HOSTADDRESS$ --port $ARG1$ --appname $ARG2$
       } 

Below is the lines added in services.cfg of nagios to add the same for host

PHP Code:

# check Tomcat Status
define service{
        use                            
generic-service
        host_name                      hostname
        service_description            Tomcat Status
        is_volatile                    0
        check_period                   24x7
        max_check_attempts             3
        normal_check_interval          3
        retry_check_interval           1
        contact_groups                 winadmins
        notification_interval          120
        notification_period            24x7
        notification_options           w
,u,c,r
        check_command               check_TomcatApplication
!8080!DEMO_32 

But on UI it says application is not running.

Please help me to figure out this issue

Habitual 02-26-2013 09:50 AM

Code:

define command{
command_name check_TomcatApplication
command_line $USER1$/check_TomcatApplication --user admin --password password --host $HOSTADDRESS$ --port $ARG1$ --appname $ARG2$
}


sunnysthakur 02-27-2013 07:13 AM

Hello,

Thanks for helping me out here.
I used hard values for --user and --password and now this is working fine.

help appreciated...

Habitual 02-27-2013 02:14 PM

Quote:

Originally Posted by sunnysthakur (Post 4900766)
I used hard values for --user and --password and now this is working fine.

help appreciated...

Glad it worked out!


All times are GMT -5. The time now is 11:00 PM.