Page 1 of 1

How to monitor JBOSS server user information and tomcat user

Posted: Tue Jun 26, 2018 6:09 am
by bcitsnm
I have read this document on "How to monitor JBOSS Server user and thread https://support.nagios.com/forum/viewto ... =6&t=34169". I want to know if there is a browser plugin or any other way where we can monitor the number of users using JBOSS and apache tomcat on a CentOS server. I have a script which does something like this. Please let me know if there is a plugin or script which can be used which can extract the details and send an email.

#!/bin/bash
COUNT=0
COUNT1=0
COUNT2=0
COUNT3=0

IFS=$'\n'

#LIST=`pgrep httpd`
#LIST1=`pgrep java`
#LIST=`ps -aef | grep httpd | grep -v grep`
#LIST1=`ps -aef | grep java | grep -v grep`

USERNAME=`cat /etc/passwd|cut -d':' -f1` # show all users


LIST=`pgrep -u root httpd`
LIST1=`pgrep -u root java`
LIST2=`pgrep -u seenu httpd`
LIST3=`pgrep -u seenu java`

for LINE in $LIST

do
COUNT=$((COUNT+1))
done
echo $COUNT

IFS=$'\n'

for LINE in $LIST1

do
COUNT1=$((COUNT1+1))
done
echo $COUNT1

IFS=$'\n'

for LINE in $LIST2

do
COUNT2=$((COUNT2+1))

done
echo $COUNT2

IFS=$'\n'

for LINE in $LIST3

do
COUNT3=$((COUNT3+1))
done
echo $COUNT3

Re: How to monitor JBOSS server user information and tomcat

Posted: Tue Jun 26, 2018 8:46 am
by scottwilkerson
Do you have Nagios Installed?

You could modify the script to be a proper plugin and Nagios can send the email when it is in a non-OK state

Here are the Nagios Plugin Development Guidelines

Re: How to monitor JBOSS server user information and tomcat

Posted: Tue Jul 03, 2018 2:25 am
by bcitsnm
Dear Mr. Scott Wilkerson,
Thank you for the information, but I would like to know if we can tweak the existing JBOSS Monitoring With Nagios plugin which is here https://exchange.nagios.org/directory/P ... 1530599211
to give the details of what I require.

The same change could also be applied to these which will be helpful for everyone. Instead of me writing a new plugin altogether again.

check_apachestatus: https://exchange.nagios.org/directory/P ... us/details
check_apache_status: https://exchange.nagios.org/directory/P ... us/details

Kindly request you to let me know if you could help me do that.

Re: How to monitor JBOSS server user information and tomcat

Posted: Tue Jul 03, 2018 9:21 am
by scottwilkerson
bcitsnm wrote:Dear Mr. Scott Wilkerson,
Thank you for the information, but I would like to know if we can tweak the existing JBOSS Monitoring With Nagios plugin which is here https://exchange.nagios.org/directory/P ... 1530599211
to give the details of what I require.

The same change could also be applied to these which will be helpful for everyone. Instead of me writing a new plugin altogether again.

check_apachestatus: https://exchange.nagios.org/directory/P ... us/details
check_apache_status: https://exchange.nagios.org/directory/P ... us/details
Yes you can modify the plugins
bcitsnm wrote:Kindly request you to let me know if you could help me do that.
I cannot help you modify the plugins.