~ubuntu-branches/ubuntu/quantal/smstools/quantal

« back to all changes in this revision

Viewing changes to src/alarm.c

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Schoenfeld
  • Date: 2009-12-04 15:05:03 UTC
  • mfrom: (4.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20091204150503-c1fj03yolimkgha8
Tags: 3.1.6-1
* New upstream version
  (Closes: #494274)
* Remove patch to fix modem timeouts; upstream includes changes that
  obsolete it
* Switch to debhelper 7 and minimize the rules file
* Add a file debian/manpage for manpage installation
* Add a debian/install file for files which need to be installed
* Add an ignore.d.server file for logcheck (Closes: #516158)
* [INTL:ja] Add Japanese po-debconf template translation
  (ja.po); thanks to Hideki Yamane
  (Closes: #558073)
* Change my email address at some places
* Make ucf call on purge conditional, so that purge does not fail if
  ucf is not installed.
* Fix pathname of smsd configuration in ucf call (its smsd.conf not
  smstools.conf)
* Remove the last changed header from smsd.conf because its annoying
  on every upgrade
* Fix a bug in the init script, that would cause the daemon to not
  properly run, if /var/run/smstools does not exist, because it
  wouldn't respect its user settings anymore.
* Make sure a symlink from /var/log/smsd.log to /var/log/smstools/smsd.log
  is created on upgrades, if /var/log/smsd.log exists.
* Change the logfile path in the default configuration to
  /var/log/smstools/smsd.log

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
SMS Server Tools 3
3
 
Copyright (C) Keijo Kasvi
 
3
Copyright (C) 2006- Keijo Kasvi
4
4
http://smstools3.kekekasvi.com/
5
5
 
6
6
Based on SMS Server Tools 2 from Stefan Frings
22
22
#include <time.h>
23
23
#include "alarm.h"
24
24
#include "extras.h"
 
25
#include "smsd_cfg.h"
25
26
 
26
27
char* _alarmhandler={0};
27
28
int _alarmlevel=LOG_WARNING;
32
33
  _alarmlevel=level;
33
34
}
34
35
 
35
 
void alarm_handler0(int severity, char *devicename, char *text)
 
36
void alarm_handler0(int severity, char *text)
36
37
{
37
 
  alarm_handler(severity, devicename, "%s", text);
 
38
  alarm_handler(severity, "%s", text);
38
39
}
39
40
 
40
 
void alarm_handler(int severity,char* devicename,char* format, ...)
 
41
void alarm_handler(int severity, char* format, ...)
41
42
{
42
43
  va_list argp;
43
44
  char text[1024];
54
55
    {
55
56
      time(&now);
56
57
      strftime(timestamp,sizeof(timestamp),"%Y-%m-%d %H:%M:%S",localtime(&now));
57
 
      snprintf(cmdline,sizeof(cmdline),"%s ALARM %s %i %s \"%s\"",_alarmhandler,timestamp,severity,devicename,text);      
 
58
      snprintf(cmdline,sizeof(cmdline),"%s ALARM %s %i %s \"%s\"",_alarmhandler,timestamp,severity, process_title, text);
58
59
      my_system(cmdline, "alarmhandler");
59
60
    }  
60
61
  }