Hi Craig

Here are the results, i repeat that i only appears using poller2.


Thanks.

   _______________
David LIMA
Professional Services
www.scc.com

-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Craig Small
Envoyé : vendredi 5 octobre 2007 14:23
À : jffnms-users@lists.sourceforge.net
Objet : Re: [jffnms-users] Consolidate and poller2 bug

On Thu, Oct 04, 2007 at 11:23:31PM +0200, LIMA David wrote:
> select * from alarms where triggered = 1 and  interface=3108;
> | id   | date_start          | date_stop           | interface | type |
> active | referer_start | referer_stop | triggered |
> | 1598 | 2007-10-04 21:57:56 | 2007-10-04 22:06:20 |      3108 |   40 |
> 12 |          2147 |         2162 |         1 |



> We can see that the duration  fonction is bad because 21 :57 :58 until
> 22 :06 :20 is not 4864 seconds but 504. If I use the poller1 function
> this test works.
564 isn't it? Giving a difference of 1 hour, 11 minutes and 40 seconds.

OK, so where does duration come from? Two places it seems!
First place is from the database;
 SELECT (date_stop - date_start) AS duration FROM alarms WHERE triggered = 1 
AND interface=3108

That should be 564, or 504 if you're calculations are correct.

[David LIMA: ] 

First problem I guess ... 

mysql> SELECT (date_stop - date_start) AS duration FROM alarms WHERE triggered 
= 1 AND interface=3108;
+-------------+
| duration    |
+-------------+
| 4864.000000 |
|  804.000000 |
|  796.000000 |
|  812.000000 |
|  692.000000 |
|  790.000000 |
|  709.000000 |
|  806.000000 |
|  767.000000 |
+-------------+
9 rows in set (0.00 sec)



The second place, for down alarms, comes calculated from the
current clock. Makes sense because you cannot calculate a down alarm
That is your servers time when it runs the command minus the start_date
Next time you get it, try this:
php -r 'echo time() - strtotime("2007-10-04 21:57:56"). "\n";'

You need to do it near the time it happens and substitute the
time with your start_date value;

[David LIMA: ] 
Not sure if it is what you want but (test the server time inside php ?)

ntsncnms2:~# date
Fri Oct  5 16:29:30 CEST 2007
ntsncnms2:~# php -r 'echo time() - strtotime("2007-10-05 16:29:30"). "\n";'
7


Can you also tell me what event with id 2147 and 2162 look like?
[David LIMA: ] 
+------+---------------------+------+------+-------------------+-------------+----------+-----------------+---------+-----+----------+
| id   | date                | type | host | interface         | state       | 
username | info            | referer | ack | analized |
+------+---------------------+------+------+-------------------+-------------+----------+-----------------+---------+-----+----------+
| 2147 | 2007-10-04 21:57:56 |   40 |  306 | Reachability Test | unreachable | 
status   | 80% Packet Loss |       0 |   1 |        1 |
+------+---------------------+------+------+-------------------+-------------+----------+-----------------+---------+-----+----------+
+------+---------------------+------+------+-------------------+-----------+----------+----------------+---------+-----+----------+
| id   | date                | type | host | interface         | state     | 
username | info           | referer | ack | analized |
+------+---------------------+------+------+-------------------+-----------+----------+----------------+---------+-----+----------+
| 2162 | 2007-10-04 22:06:20 |   40 |  306 | Reachability Test | reachable | 
status   | 0% Packet Loss |       0 |   1 |        1 |
+------+---------------------+------+------+-------------------+-----------+----------+----------------+---------+-----+----------+

-- 
Craig Small      GnuPG:1C1B D893 1418 2AF4 45EE  95CB C76C E5AC 12CA DFA5
http://www.enc.com.au/                             csmall at : enc.com.au
http://www.debian.org/          Debian GNU/Linux, software should be Free 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
jffnms-users mailing list
jffnms-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jffnms-users


______________________________________________________________________
Ce message contient des informations dont le contenu est susceptible d'etre 
confidentiel.
Il est destine au(x) destinataire(s) indique(s) exclusivement.

A moins que vous ne fassiez partie de la liste des destinataires, ou que vous 
soyez habilite a recevoir le mail a leur place, il vous est interdit de le 
copier, de l'utiliser ou de devoiler son contenu a un tiers.

Si vous avez recu cet email par erreur, merci de prendre contact avec 
l'emetteur.

Les opinions exprimees dans cet e-mail sont celles de l'emetteur et ne 
refletent pas necessairement celles de l'entreprise.

Ce e-mail peut contenir des pieces jointes dont certaines pourraient contenir 
des virus qui pourraient endommager votre systeme informatique.

La compagnie a pris toutes dispositions afin de minimiser ce risque et decline 
toute responsabilite pour toute perte ou dommage resultant directement ou 
indirectement de l'utilisation de cet email ou de son contenu.

Il vous appartient d'effectuer vos propres controles anti-virus avant d'ouvrir 
la ou les pieces jointes.
______________________________________________________________________

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
jffnms-users mailing list
jffnms-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jffnms-users

Reply via email to