Tomcat6 You need root priviledges to run this script

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
PCrossan
Posts: 6
Joined: Fri Jan 25, 2013 4:10 am

Tomcat6 You need root priviledges to run this script

Post by PCrossan »

Hello

Nagios issue:

We are using nagios XI and have come across a issue with monitoring tomcat6 - the command that gets run is check_nrpe!check_init_service!-a 'tomcat6'

With the error message You need root privileges to run this script

Tomcat6 is not a public facing for us we use it as a servlet running locally on the linux box. We use apache as the main public web server and this gets picked up fine by using the same check..

Is the above command correct for this set-up of tomcat or do we look to monitor this a different way?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Tomcat6 You need root priviledges to run this script

Post by slansing »

Does the plugin script itself have the correct permissions to be executed? It seems that is the problem you are running into, I also assume by "it as a servlet running locally on the linux box" you mean locally on the remote linux box? If it is locally on the Nagios server you do not need to call the plugin with check_nrpe.
PCrossan
Posts: 6
Joined: Fri Jan 25, 2013 4:10 am

Re: Tomcat6 You need root priviledges to run this script

Post by PCrossan »

Hi,

yes its running locally on the remote linux machine and the scripts have permissions that have been given
so for check_nrpe its

-rwxrwxr-x 1 nagios nagios 75444 Aug 22 2012 check_nrpe
and for check_init_service its
-rwxrwxr-x 1 nagios nagios

check_init_service
should these been chmod to root

thanks

Paul
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Tomcat6 You need root priviledges to run this script

Post by abrist »

You may have to add a sudoers rules, set the suid execute bit, or both. See the following document:
http://assets.nagios.com/downloads/nagi ... utions.pdf
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Tomcat6 You need root priviledges to run this script

Post by sreinhardt »

Are you able to run the command correctly by ssh-ing into the remote machine and using the same command? Where did you find the plugin?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
bkelly
Posts: 10
Joined: Thu Mar 21, 2013 9:27 am

Re: Tomcat6 You need root priviledges to run this script

Post by bkelly »

Hi

I've done a change to the permissions to the sudoers files to add the rights as suggested

/etc/sudoers

nagios ALL = NOPASSWD:/usr/local/nrdp/plugins/AIX/check_init_service
nagios ALL = NOPASSWD:/usr/local/nagios/libexec/check_nrpe

Nagios still shows the same error message as before :-(
PCrossan
Posts: 6
Joined: Fri Jan 25, 2013 4:10 am

Re: Tomcat6 You need root priviledges to run this script

Post by PCrossan »

Haven't been able to run the command via ssh as it appears to use two commands as shown in the first post and this is just the standard monitor service command via the nagiosXI wizard

permission have been set in /etc/sudoers
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Tomcat6 You need root priviledges to run this script

Post by abrist »

You could try setting the execute bit. Is this system running selinux?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Tomcat6 You need root priviledges to run this script

Post by abrist »

Additionally, you may want to look at the script as it may be calling a system binary that you need to set a sudoers rule for. Have you tried the "check_procs" plugin?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
bkelly
Posts: 10
Joined: Thu Mar 21, 2013 9:27 am

Re: Tomcat6 You need root priviledges to run this script

Post by bkelly »

Hi

Thanks for the reply - I will need to check all this as this is the appliance downloaded straight from nagios website so we thought it was all set to go?

As far as I can see its disabled

SELinux status: disabled
Locked