Xymon Mailing List Archive search

ackcode in log file

7 messages in this thread

list Asif Iqbal · Fri, 2 Jul 2010 12:26:38 -0400 ·
Does anyone know if any of the hobbit server log files contain the
ackcode in it? I do not think it does by default. I could not find it
in my
limited query. I know SCRIPT has the ACKCODE. But I am asking if it is
in any of the log file by default.

If the answer is no, then what would it take to add the ackcode in
notification log file ? I am guessing some code change
on lib/notifylog.c 's  do_notifylog function would be necessary along
with some change in lib/notifylog.h.

Please advise


-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
list Sean Clark · Fri, 2 Jul 2010 12:38:21 -0400 ·
Acknowledge.log in the logs directory
quoted from Asif Iqbal

-----Original Message-----
From: Asif Iqbal [mailto:user-6f4b51ac2a40@xymon.invalid] 
Sent: Friday, July 02, 2010 12:27 PM
To: user-ae9b8668bcde@xymon.invalid
Cc: Xymon Developers
Subject: [Hobbitmon-developer] ackcode in log file

Does anyone know if any of the hobbit server log files contain the
ackcode in it? I do not think it does by default. I could not find it
in my
limited query. I know SCRIPT has the ACKCODE. But I am asking if it is
in any of the log file by default.

If the answer is no, then what would it take to add the ackcode in
notification log file ? I am guessing some code change
on lib/notifylog.c 's  do_notifylog function would be necessary along
with some change in lib/notifylog.h.

Please advise


-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
Hobbitmon-developer mailing list
user-f970bfd1395f@xymon.invalid
This E-mail and any of its attachments may contain Time Warner
Cable proprietary information, which is privileged, confidential,
or subject to copyright belonging to Time Warner Cable. This E-mail
is intended solely for the use of the individual or entity to which
it is addressed. If you are not the intended recipient of this
E-mail, you are hereby notified that any dissemination,
distribution, copying, or action taken in relation to the contents
of and attachments to this E-mail is strictly prohibited and may be
unlawful. If you have received this E-mail in error, please notify
the sender immediately and permanently delete the original and any
copy of this E-mail and any printout.
list Asif Iqbal · Fri, 2 Jul 2010 12:45:29 -0400 ·
On Fri, Jul 2, 2010 at 12:38 PM, Clark, Sean <user-2db5fbcae9a7@xymon.invalid> wrote:
Acknowledge.log in the logs directory
Hi Sean,

That is not really what I am asking for. That is only the log if
someone acknowledges it.

It is really the alert code that we may or may not ack. Since alerts
gets logged in
notifications.log file. So would be a logical place to have the alert
code in there as well,
even if we never ACK it
quoted from Asif Iqbal
-----Original Message-----
From: Asif Iqbal [mailto:user-6f4b51ac2a40@xymon.invalid]
Sent: Friday, July 02, 2010 12:27 PM
To: user-ae9b8668bcde@xymon.invalid
Cc: Xymon Developers
Subject: [Hobbitmon-developer] ackcode in log file

Does anyone know if any of the hobbit server log files contain the
ackcode in it? I do not think it does by default. I could not find it
in my
limited query. I know SCRIPT has the ACKCODE. But I am asking if it is
in any of the log file by default.

If the answer is no, then what would it take to add the ackcode in
notification log file ? I am guessing some code change
on lib/notifylog.c 's  do_notifylog function would be necessary along
with some change in lib/notifylog.h.

Please advise


--
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
Hobbitmon-developer mailing list
user-f970bfd1395f@xymon.invalid
This E-mail and any of its attachments may contain Time Warner
Cable proprietary information, which is privileged, confidential,
or subject to copyright belonging to Time Warner Cable. This E-mail
is intended solely for the use of the individual or entity to which
it is addressed. If you are not the intended recipient of this
E-mail, you are hereby notified that any dissemination,
distribution, copying, or action taken in relation to the contents
of and attachments to this E-mail is strictly prohibited and may be
unlawful. If you have received this E-mail in error, please notify
the sender immediately and permanently delete the original and any
copy of this E-mail and any printout.

-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
list Asif Iqbal · Tue, 20 Jul 2010 16:06:53 -0400 ·
quoted from Asif Iqbal
On Fri, Jul 2, 2010 at 12:45 PM, Asif Iqbal <user-6f4b51ac2a40@xymon.invalid> wrote:
On Fri, Jul 2, 2010 at 12:38 PM, Clark, Sean <user-2db5fbcae9a7@xymon.invalid> wrote:
Acknowledge.log in the logs directory
Hi Sean,

That is not really what I am asking for. That is only the log if
someone acknowledges it.

It is really the alert code that we may or may not ack. Since alerts
gets logged in
notifications.log file. So would be a logical place to have the alert
code in there as well,
even if we never ACK it
so looks like I just need to modify the hobbitd/do_alert.c line 148 to
150 to add the cookie if I want it
the alert code to show up in notifications.log file. Is there any
other places I need to make change
as well?

137         if ((alert->color >= 0) && (alert->color < COL_COUNT)) sev
= sevtxt[alert->color];
138
139         switch (alert->state) {
140           case A_PAGING:
141           case A_ACKED:
142                 subjfmt = (include_configid ? "Hobbit [%d] %s:%s
%s [cfid:%d]" :  "Hobbit [%d] %s:%s %s");
143                 snprintf(subj, sizeof(subj)-1, subjfmt,
144                          alert->cookie, alert->hostname,
alert->testname, sev, recip->cfid);
145                 break;
146
147           case A_NOTIFY:
148                 subjfmt = (include_configid ? "Hobbit %s:%s NOTICE
[cfid:%d]" :  "Hobbit %s:%s NOTICE");
149                 snprintf(subj, sizeof(subj)-1, subjfmt,
150                          alert->hostname, alert->testname, recip->cfid);
151                 break;
152
153           case A_RECOVERED:
154                 subjfmt = (include_configid ? "Hobbit %s:%s
recovered [cfid:%d]" :  "Hobbit %s:%s recovered");
155                 snprintf(subj, sizeof(subj)-1, subjfmt,
156                          alert->hostname, alert->testname, recip->cfid);
157                 break;
158
159           case A_NORECIP:
160           case A_DEAD:
161                 /* Cannot happen */
162                 break;
163         }
quoted from Asif Iqbal

-----Original Message-----
From: Asif Iqbal [mailto:user-6f4b51ac2a40@xymon.invalid]
Sent: Friday, July 02, 2010 12:27 PM
To: user-ae9b8668bcde@xymon.invalid
Cc: Xymon Developers
Subject: [Hobbitmon-developer] ackcode in log file

Does anyone know if any of the hobbit server log files contain the
ackcode in it? I do not think it does by default. I could not find it
in my
limited query. I know SCRIPT has the ACKCODE. But I am asking if it is
in any of the log file by default.

If the answer is no, then what would it take to add the ackcode in
notification log file ? I am guessing some code change
on lib/notifylog.c 's  do_notifylog function would be necessary along
with some change in lib/notifylog.h.

Please advise


--
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
Hobbitmon-developer mailing list
user-f970bfd1395f@xymon.invalid
This E-mail and any of its attachments may contain Time Warner
Cable proprietary information, which is privileged, confidential,
or subject to copyright belonging to Time Warner Cable. This E-mail
is intended solely for the use of the individual or entity to which
it is addressed. If you are not the intended recipient of this
E-mail, you are hereby notified that any dissemination,
distribution, copying, or action taken in relation to the contents
of and attachments to this E-mail is strictly prohibited and may be
unlawful. If you have received this E-mail in error, please notify
the sender immediately and permanently delete the original and any
copy of this E-mail and any printout.

--
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
list Asif Iqbal · Wed, 21 Jul 2010 12:56:29 -0400 ·
quoted from Asif Iqbal
On Tue, Jul 20, 2010 at 4:06 PM, Asif Iqbal <user-6f4b51ac2a40@xymon.invalid> wrote:
On Fri, Jul 2, 2010 at 12:45 PM, Asif Iqbal <user-6f4b51ac2a40@xymon.invalid> wrote:
On Fri, Jul 2, 2010 at 12:38 PM, Clark, Sean <user-2db5fbcae9a7@xymon.invalid> wrote:
Acknowledge.log in the logs directory
Hi Sean,

That is not really what I am asking for. That is only the log if
someone acknowledges it.

It is really the alert code that we may or may not ack. Since alerts
gets logged in
notifications.log file. So would be a logical place to have the alert
code in there as well,
even if we never ACK it
so looks like I just need to modify the hobbitd/do_alert.c line 148 to
150 to add the cookie if I want it
the alert code to show up in notifications.log file. Is there any
other places I need to make change
as well?

137         if ((alert->color >= 0) && (alert->color < COL_COUNT)) sev
= sevtxt[alert->color];
138
139         switch (alert->state) {
140           case A_PAGING:
141           case A_ACKED:
142                 subjfmt = (include_configid ? "Hobbit [%d] %s:%s
%s [cfid:%d]" :  "Hobbit [%d] %s:%s %s");
143                 snprintf(subj, sizeof(subj)-1, subjfmt,
144                          alert->cookie, alert->hostname,
alert->testname, sev, recip->cfid);
145                 break;
146
147           case A_NOTIFY:
148                 subjfmt = (include_configid ? "Hobbit %s:%s NOTICE
[cfid:%d]" :  "Hobbit %s:%s NOTICE");
149                 snprintf(subj, sizeof(subj)-1, subjfmt,
150                          alert->hostname, alert->testname, recip->cfid);
151                 break;
152
153           case A_RECOVERED:
154                 subjfmt = (include_configid ? "Hobbit %s:%s
recovered [cfid:%d]" :  "Hobbit %s:%s recovered");
155                 snprintf(subj, sizeof(subj)-1, subjfmt,
156                          alert->hostname, alert->testname, recip->cfid);
157                 break;
158
159           case A_NORECIP:
160           case A_DEAD:
161                 /* Cannot happen */
162                 break;
163         }
I am still playing with the ackcode/alertcode to put into
notifications.log. Looks like I actually
have to modify the code here

   387                                          if (logfd) {
   388                                                  init_timestamp();
   389                                                  fprintf(logfd,
"%s %s.%s (%s) %s[%d] %ld %d",
   390
timestamp, alert->hostname, alert->testname,
   391
alert->ip, recip->recipient, recip->cfid,
   392
(long)now, servicecode(alert->testname));
   393                                                  if
(alert->state == A_RECOVERED) {
   394
fprintf(logfd, " %ld\n", (long)(now - alert->eventstart));
   395                                                  }
   396                                                  else {
   397
fprintf(logfd, "\n");
   398                                                  }
   399                                                  fflush(logfd);
   400                                          }

I have to add alert->cookie in there. Will confirm it that works
quoted from Asif Iqbal
-----Original Message-----
From: Asif Iqbal [mailto:user-6f4b51ac2a40@xymon.invalid]
Sent: Friday, July 02, 2010 12:27 PM
To: user-ae9b8668bcde@xymon.invalid
Cc: Xymon Developers
Subject: [Hobbitmon-developer] ackcode in log file

Does anyone know if any of the hobbit server log files contain the
ackcode in it? I do not think it does by default. I could not find it
in my
limited query. I know SCRIPT has the ACKCODE. But I am asking if it is
in any of the log file by default.

If the answer is no, then what would it take to add the ackcode in
notification log file ? I am guessing some code change
on lib/notifylog.c 's  do_notifylog function would be necessary along
with some change in lib/notifylog.h.

Please advise


--
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
Hobbitmon-developer mailing list
user-f970bfd1395f@xymon.invalid
This E-mail and any of its attachments may contain Time Warner
Cable proprietary information, which is privileged, confidential,
or subject to copyright belonging to Time Warner Cable. This E-mail
is intended solely for the use of the individual or entity to which
it is addressed. If you are not the intended recipient of this
E-mail, you are hereby notified that any dissemination,
distribution, copying, or action taken in relation to the contents
of and attachments to this E-mail is strictly prohibited and may be
unlawful. If you have received this E-mail in error, please notify
the sender immediately and permanently delete the original and any
copy of this E-mail and any printout.

--
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
--
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
list Asif Iqbal · Thu, 22 Jul 2010 10:43:07 -0400 ·
quoted from Asif Iqbal
On Wed, Jul 21, 2010 at 2:11 PM, Asif Iqbal <user-6f4b51ac2a40@xymon.invalid> wrote:
On Wed, Jul 21, 2010 at 12:56 PM, Asif Iqbal <user-6f4b51ac2a40@xymon.invalid> wrote:
On Tue, Jul 20, 2010 at 4:06 PM, Asif Iqbal <user-6f4b51ac2a40@xymon.invalid> wrote:
On Fri, Jul 2, 2010 at 12:45 PM, Asif Iqbal <user-6f4b51ac2a40@xymon.invalid> wrote:
On Fri, Jul 2, 2010 at 12:38 PM, Clark, Sean <user-2db5fbcae9a7@xymon.invalid> wrote:
Acknowledge.log in the logs directory
Hi Sean,

That is not really what I am asking for. That is only the log if
someone acknowledges it.

It is really the alert code that we may or may not ack. Since alerts
gets logged in
notifications.log file. So would be a logical place to have the alert
code in there as well,
even if we never ACK it
so looks like I just need to modify the hobbitd/do_alert.c line 148 to
150 to add the cookie if I want it
the alert code to show up in notifications.log file. Is there any
other places I need to make change
as well?

137         if ((alert->color >= 0) && (alert->color < COL_COUNT)) sev
= sevtxt[alert->color];
138
139         switch (alert->state) {
140           case A_PAGING:
141           case A_ACKED:
142                 subjfmt = (include_configid ? "Hobbit [%d] %s:%s
%s [cfid:%d]" :  "Hobbit [%d] %s:%s %s");
143                 snprintf(subj, sizeof(subj)-1, subjfmt,
144                          alert->cookie, alert->hostname,
alert->testname, sev, recip->cfid);
145                 break;
146
147           case A_NOTIFY:
148                 subjfmt = (include_configid ? "Hobbit %s:%s NOTICE
[cfid:%d]" :  "Hobbit %s:%s NOTICE");
149                 snprintf(subj, sizeof(subj)-1, subjfmt,
150                          alert->hostname, alert->testname, recip->cfid);
151                 break;
152
153           case A_RECOVERED:
154                 subjfmt = (include_configid ? "Hobbit %s:%s
recovered [cfid:%d]" :  "Hobbit %s:%s recovered");
155                 snprintf(subj, sizeof(subj)-1, subjfmt,
156                          alert->hostname, alert->testname, recip->cfid);
157                 break;
158
159           case A_NORECIP:
160           case A_DEAD:
161                 /* Cannot happen */
162                 break;
163         }
I am still playing with the ackcode/alertcode to put into
notifications.log. Looks like I actually
have to modify the code here

  387                                          if (logfd) {
  388                                                  init_timestamp();
  389                                                  fprintf(logfd,
"%s %s.%s (%s) %s[%d] %ld %d",
  390
timestamp, alert->hostname, alert->testname,
  391
alert->ip, recip->recipient, recip->cfid,
  392
(long)now, servicecode(alert->testname));
  393                                                  if
(alert->state == A_RECOVERED) {
  394
fprintf(logfd, " %ld\n", (long)(now - alert->eventstart));
  395                                                  }
  396                                                  else {
  397
fprintf(logfd, "\n");
  398                                                  }
  399                                                  fflush(logfd);
  400                                          }

I have to add alert->cookie in there. Will confirm it that works
ok so I applied this patch.

--- hobbitd/do_alert.c.orig     2010-07-21 13:36:07.000000000 -0400
+++ hobbitd/do_alert.c  2010-07-21 13:36:32.000000000 -0400
@@ -414,8 +414,8 @@
                                       pclose(mailpipe);
                                       if (logfd) {
                                               init_timestamp();
-                                               fprintf(logfd, "%s
%s.%s (%s) %s[%d] %ld %d",
-                                                       timestamp,
alert->hostname, alert->testname,
+                                               fprintf(logfd, "%s %d
%s.%s (%s) %s[%d] %ld %d",
+                                                       timestamp,
alert->cookie, alert->hostname, alert->testname,
                                                       alert->ip,
recip->recipient, recip->cfid,
                                                       (long)now,
servicecode(alert->testname));
                                               if (alert->state ==
A_RECOVERED) {

Then make clean; make; make install . But I still do not see the
ackcode/alertcode in the notifications.log file.

Any suggestion?
ok, the patch worked. I had to restart hobbitd_alert, doh!

Here is the patch as an attachment, if anyone is interested.

It puts the same alertcode, that you receive in the subject of your
hobbit alert, into
the notifications log as well. we feed this log to splunk and it helps with
our stat on total number of unique alerts per day
quoted from Asif Iqbal


-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
Attachments (1)
list David Peters · Tue, 24 Aug 2010 08:41:41 +1000 ·
Is it just me, or do i really keep bumping into references to theshire which no longer exists as far as i can ascertain?

Even the wiki and xymon.com reference this site which is pretty poor form. How do we go about getting this removed. And where is the repoistory of add-ons now?
This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of their organisation.