how to configure urchin to send email when a task status changed to warning or error

21 views
Skip to first unread message

kiran kumar

unread,
Jan 2, 2014, 11:12:22 AM1/2/14
to urchin...@googlegroups.com
hi,
I am using urchin v6.4.0.2  and use log processor. I can't find a way to configure Urchin to send an email when a task status changed to "Error" or "warning".  Any help or suggestions would be of great help.

Thanks in advance,
Kiran

Jeff Sturm

unread,
Jan 2, 2014, 11:57:28 AM1/2/14
to urchin...@googlegroups.com

Hi,

 

Urchin has no native facility to do that as far as I am aware.  Since we use Nagios to watch all our production hosts, we extended Nagios to monitor Urchin task detail and send us pager/email notifications.  You could do the same if you have Nagios or a similar tool.

 

If you use Nagios and have just a few profiles, the check_logfiles extension with log rotation should work.  Since we have many, we wrote a custom plugin to query the uprofiles_tasks table for task status.  The one below was created in perl for MySQL, but can easily be adapted for similar uses:

 

#!/usr/bin/perl

 

use DBI;

 

my $dbh = DBI->connect('dbi:mysql:urchinconf', {PrintError => 0, RaiseError => 1}) || die $DBI::errstr;

my $rs = $dbh->selectall_arrayref("SELECT ucpr_name FROM uprofiles_tasks WHERE uipt_status = 2 AND utpt_mtime > DATE_SUB(NOW(), INTERVAL 1 DAY)", {Slice => {}});

$dbh->disconnect();

 

if (@$rs) {

  print "WARNING - urchin task scheduler has " . @$rs . " warnings from within the past 24 hours:\n";

  foreach (@$rs) {

    print $_->{ucpr_name}, "\n";

  }

  exit(1);

}

 

print "OK - no warnings in urchin task scheduler history within last 24 hours\n";

 

-Jeff

--
You received this message because you are subscribed to the Google Groups "Urchin 6" group.
To unsubscribe from this group and stop receiving emails from it, send an email to urchin-help-...@googlegroups.com.
To post to this group, send email to urchin...@googlegroups.com.
Visit this group at http://groups.google.com/group/urchin-help-6.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages