Ger Apeldoorn | 12 Oct 2006 10:43
Picon
Favicon

Running the agent with a higher priority

Hi all,

We are running some CPU intensive applications on our monitored servers. As 
these servers are critical for our business, I am monitoring them with 
Zabbix. 

I made a custom trigger that monitors the age of the last update to a logfile. 
If it is older that 20 minutes, it is assumed that the application crashed 
and alerts are generated.

However, we are getting false positives. If the server is running its 
calculations, it does not always respond to the polling of the master server 
and the timestamp of the monitored logfile is not updated accordingly. 

To resolve this, I reniced the Zabbix agent processes to 0. (Same as the 
application) I hope this will resolve this. 

How can I run the agents with nice 0 when I start them using the init.d 
script?

I am  on RHEL 4.

Many thanks,
Ger.

--

-- 
ARGOSS: your partner for atmospheric, marine & coastal information
P O Box 61
8325ZH Vollenhove The Netherlands
tel +31-527-242299 fax +31-527-242016
(Continue reading)

Terry Dooher | 12 Oct 2006 13:37
Favicon

Re: Running the agent with a higher priority

Ger Apeldoorn wrote:

> How can I run the agents with nice 0 when I start them using the init.d 
> script?
> 
> I am  on RHEL 4.

I haven't used RedHat in a long while, but it shouldn't be too hard to add a 
'nice 0' prefix to the invocation of zabbix_agentd. I suppose it's complicated 
by the way that redhat includes a lot of external functions for its init 
scripts. Can you paste the 'start)' section of the script here?

Terry.

> Many thanks,
> Ger.
> 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Ger Apeldoorn | 12 Oct 2006 14:21
Picon
Favicon

Re: Running the agent with a higher priority

Hi,

Thanks for responding!

I'll post all of the initscript here:

Looks like I cant change the ZABBIX_AGENTD variable, as it is tested to make 
sure it exists..

Thanks again,
Ger.

--------------------%<------------------------

#!/bin/sh
#
# zabbix_agentd_ctl
#
# control script to stop/start/restart zabbix_agentd
# author: charlie collins
# date: 01.21.2002
#
# revised 09.21.2003
# (setup for Red Hat 7.3 with Zabbix 1.0 beta)
# (should work for other Red Hat and Sys V style init machines as well)
#
# (modeled after apache style control scripts)
# (this script can be placed in init.d and respective runlevel for startup 
usage
)
(Continue reading)

Picon

Re: Running the agent with a higher priority

Ger Apeldoorn wrote:

> Looks like I cant change the ZABBIX_AGENTD variable, as it is  
> tested to make
> sure it exists..

But you can add the nice part before ZABBIX_AGENTD in the start)  
section.

Nils Breunese.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Terry Dooher | 12 Oct 2006 17:00
Favicon

Re: Running the agent with a higher priority

the lines starting:

	if $ZABBIX_AGENTD ...

aren't checking for the existence of the file, they're running the command 
referenced by ZABBIX_AGENTD and basing the decision on the exit status.
I assume zabbix_agentd will return a non-zero exit status if it fails to start 
for whatever reason.

If you altered these lines to:

	if nice -0 $ZABBIX_AGENTD ...

then I think you'll be basing the decision on the exit status of nice, not of 
zabbix_agentd, so the script may not behave itself.

The other issue is that zabbix_agentd seems to renice itself after running (at 
least it does on my self-compiled version), so the nice prefix probably won't 
work at all.

I'd suggest adding a renice line in the sections that report a successful start:

         start)
         if [ $RUNNING -eq 1 ]; then
             echo "$0 $ARG: zabbix_agentd (pid $PID) already running"
             continue
         fi
         if $ZABBIX_AGENTD ; then
	    NEWPID=`cat $PIDFILE`	# Get the new pid
	    renice -0 -p $NEWPID		# renice it.
(Continue reading)

Ger Apeldoorn | 13 Oct 2006 07:53
Picon
Favicon

Re: Running the agent with a higher priority

Op donderdag 12 oktober 2006 16:40, schreef u:
> Would it be possible to get the contents of the trigger you described? I
> could see a need for that in my installation in the near future.

Yes, of course:
1) make an item for system.localtime
2) make an item for the timestamp of the file: vfs.file.time[/tmp/logfile]
3) make a trigger like this: 
{Servername:system.localtime.last(0)}>{Servername:vfs.file.time[/tmp/logfile].last(0)}+MaxDifferenceInSeconds
Of course, MaxDifferenceInSeconds is a number. Dont set it too small, 
otherwise it'll get triggerhappy. Add at least 10 minutes to the delay you 
want to monitor or you'll get many false-positives.

Many thanks to all for your help!!

Ger.

>
> On Thu, 2006-10-12 at 10:43 +0200, Ger Apeldoorn wrote:
> > Hi all,
> >
> > We are running some CPU intensive applications on our monitored servers.
> > As these servers are critical for our business, I am monitoring them with
> > Zabbix.
> >
> > I made a custom trigger that monitors the age of the last update to a
> > logfile. If it is older that 20 minutes, it is assumed that the
> > application crashed and alerts are generated.
> >
> > However, we are getting false positives. If the server is running its
(Continue reading)

Nikesh Maharaj | 18 Oct 2006 17:52
Picon

Re: Running the agent with a higher priority

Hi, 

I am trying to install zabbix on Debian. I have added the line

deb http://mirror.opf.slu.cz/zabbix stable contrib

to my sources list. When I try to do 

apt-get install zabbix-frontend-php zabbix-server zabbix-agent 

I get error message about downloading package that don't exist .. 

-----Original Message-----
From: zabbix-users-bounces <at> lists.sourceforge.net
[mailto:zabbix-users-bounces <at> lists.sourceforge.net] On Behalf Of Ger
Apeldoorn
Sent: 13 October 2006 07:53 AM
To: zabbix-users <at> lists.sourceforge.net
Subject: Re: [Zabbix-users] Running the agent with a higher priority

Op donderdag 12 oktober 2006 16:40, schreef u:
> Would it be possible to get the contents of the trigger you described?
I
> could see a need for that in my installation in the near future.

Yes, of course:
1) make an item for system.localtime
2) make an item for the timestamp of the file:
vfs.file.time[/tmp/logfile]
3) make a trigger like this: 
(Continue reading)

Nikesh Maharaj | 19 Oct 2006 08:46
Picon

Error

When I call up my web page I get this error :

Fatal error: Call to undefined function: mysql_pconnect() in
/var/www/zabbix/include/db.inc.php on line 40

Not sure what to do now 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Ger Apeldoorn | 19 Oct 2006 08:53
Picon
Favicon

Re: Error

Op donderdag 19 oktober 2006 08:46, schreef Nikesh Maharaj:
> Fatal error: Call to undefined function: mysql_pconnect() in

you probably just need to enable the mysql module for php...

Ger.

-- 
ARGOSS: your partner for atmospheric, marine & coastal information
P O Box 61
8325ZH Vollenhove The Netherlands
tel +31-527-242299 fax +31-527-242016
Web http://www.argoss.nl

Confidentiality Notice & Disclaimer
The contents of this e-mail and any attachments are intended only for the
use of the e-mail addressee(s) shown. If you are not that person, or one of
those persons, you are not allowed to take any action based upon it or to
copy it, forward, distribute or disclose the contents of it and you should
please delete it from your system.

ARGOSS Holding BV and its subsidiaries do not accept any liability for any
errors or omissions in the context of this e-mail or its attachments which
arise as a result of Internet transmission, nor accept liability for
statements which are those of the author and not clearly made on behalf of
ARGOSS.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
(Continue reading)

Gregory Machin | 19 Oct 2006 08:54
Picon

Re: Error

Hi
Check that you have the required mysql support in the php.
Check that the username and password and database are correcrtly specified.

Nikesh Maharaj wrote:
> When I call up my web page I get this error :
>
> Fatal error: Call to undefined function: mysql_pconnect() in
> /var/www/zabbix/include/db.inc.php on line 40
>
> Not sure what to do now 
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Zabbix-users mailing list
> Zabbix-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/zabbix-users
>
>   

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
(Continue reading)


Gmane