"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/p.y" between
monit-5.25.3.tar.gz and monit-5.26.0.tar.gz

About: Monit is a utility for managing and monitoring processes, files, directories and filesystems (with automatic error recovery).

p.y  (monit-5.25.3):p.y  (monit-5.26.0)
skipping to change at line 325 skipping to change at line 325
%token SET LOGFILE FACILITY DAEMON SYSLOG MAILSERVER HTTPD ALLOW REJECTOPT ADDRE SS INIT TERMINAL BATCH %token SET LOGFILE FACILITY DAEMON SYSLOG MAILSERVER HTTPD ALLOW REJECTOPT ADDRE SS INIT TERMINAL BATCH
%token READONLY CLEARTEXT MD5HASH SHA1HASH CRYPT DELAY %token READONLY CLEARTEXT MD5HASH SHA1HASH CRYPT DELAY
%token PEMFILE ENABLE DISABLE SSL CIPHER CLIENTPEMFILE ALLOWSELFCERTIFICATION SE LFSIGNED VERIFY CERTIFICATE CACERTIFICATEFILE CACERTIFICATEPATH VALID %token PEMFILE ENABLE DISABLE SSL CIPHER CLIENTPEMFILE ALLOWSELFCERTIFICATION SE LFSIGNED VERIFY CERTIFICATE CACERTIFICATEFILE CACERTIFICATEPATH VALID
%token INTERFACE LINK PACKET BYTEIN BYTEOUT PACKETIN PACKETOUT SPEED SATURATION UPLOAD DOWNLOAD TOTAL %token INTERFACE LINK PACKET BYTEIN BYTEOUT PACKETIN PACKETOUT SPEED SATURATION UPLOAD DOWNLOAD TOTAL
%token IDFILE STATEFILE SEND EXPECT CYCLE COUNT REMINDER REPEAT %token IDFILE STATEFILE SEND EXPECT CYCLE COUNT REMINDER REPEAT
%token LIMITS SENDEXPECTBUFFER EXPECTBUFFER FILECONTENTBUFFER HTTPCONTENTBUFFER PROGRAMOUTPUT NETWORKTIMEOUT PROGRAMTIMEOUT STARTTIMEOUT STOPTIMEOUT RESTARTTIME OUT %token LIMITS SENDEXPECTBUFFER EXPECTBUFFER FILECONTENTBUFFER HTTPCONTENTBUFFER PROGRAMOUTPUT NETWORKTIMEOUT PROGRAMTIMEOUT STARTTIMEOUT STOPTIMEOUT RESTARTTIME OUT
%token PIDFILE START STOP PATHTOK %token PIDFILE START STOP PATHTOK
%token HOST HOSTNAME PORT IPV4 IPV6 TYPE UDP TCP TCPSSL PROTOCOL CONNECTION %token HOST HOSTNAME PORT IPV4 IPV6 TYPE UDP TCP TCPSSL PROTOCOL CONNECTION
%token ALERT NOALERT MAILFORMAT UNIXSOCKET SIGNATURE %token ALERT NOALERT MAILFORMAT UNIXSOCKET SIGNATURE
%token TIMEOUT RETRY RESTART CHECKSUM EVERY NOTEVERY %token TIMEOUT RETRY RESTART CHECKSUM EVERY NOTEVERY
%token DEFAULT HTTP HTTPS APACHESTATUS FTP SMTP SMTPS POP POPS IMAP IMAPS CLAMAV NNTP NTP3 MYSQL DNS WEBSOCKET %token DEFAULT HTTP HTTPS APACHESTATUS FTP SMTP SMTPS POP POPS IMAP IMAPS CLAMAV NNTP NTP3 MYSQL DNS WEBSOCKET MQTT
%token SSH DWP LDAP2 LDAP3 RDATE RSYNC TNS PGSQL POSTFIXPOLICY SIP LMTP GPS RADI US MEMCACHE REDIS MONGODB SIEVE SPAMASSASSIN FAIL2BAN %token SSH DWP LDAP2 LDAP3 RDATE RSYNC TNS PGSQL POSTFIXPOLICY SIP LMTP GPS RADI US MEMCACHE REDIS MONGODB SIEVE SPAMASSASSIN FAIL2BAN
%token <string> STRING PATH MAILADDR MAILFROM MAILREPLYTO MAILSUBJECT %token <string> STRING PATH MAILADDR MAILFROM MAILREPLYTO MAILSUBJECT
%token <string> MAILBODY SERVICENAME STRINGNAME %token <string> MAILBODY SERVICENAME STRINGNAME
%token <number> NUMBER PERCENT LOGLIMIT CLOSELIMIT DNSLIMIT KEEPALIVELIMIT %token <number> NUMBER PERCENT LOGLIMIT CLOSELIMIT DNSLIMIT KEEPALIVELIMIT
%token <number> REPLYLIMIT REQUESTLIMIT STARTLIMIT WAITLIMIT GRACEFULLIMIT %token <number> REPLYLIMIT REQUESTLIMIT STARTLIMIT WAITLIMIT GRACEFULLIMIT
%token <number> CLEANUPLIMIT %token <number> CLEANUPLIMIT
%token <real> REAL %token <real> REAL
%token CHECKPROC CHECKFILESYS CHECKFILE CHECKDIR CHECKHOST CHECKSYSTEM CHECKFIFO CHECKPROGRAM CHECKNET %token CHECKPROC CHECKFILESYS CHECKFILE CHECKDIR CHECKHOST CHECKSYSTEM CHECKFIFO CHECKPROGRAM CHECKNET
%token THREADS CHILDREN METHOD GET HEAD STATUS ORIGIN VERSIONOPT READ WRITE OPER ATION SERVICETIME DISK %token THREADS CHILDREN METHOD GET HEAD STATUS ORIGIN VERSIONOPT READ WRITE OPER ATION SERVICETIME DISK
%token RESOURCE MEMORY TOTALMEMORY LOADAVG1 LOADAVG5 LOADAVG15 SWAP %token RESOURCE MEMORY TOTALMEMORY LOADAVG1 LOADAVG5 LOADAVG15 SWAP
%token MODE ACTIVE PASSIVE MANUAL ONREBOOT NOSTART LASTSTATE CPU TOTALCPU CPUUSE R CPUSYSTEM CPUWAIT %token MODE ACTIVE PASSIVE MANUAL ONREBOOT NOSTART LASTSTATE CORE CPU TOTALCPU C PUUSER CPUSYSTEM CPUWAIT
%token GROUP REQUEST DEPENDS BASEDIR SLOT EVENTQUEUE SECRET HOSTHEADER %token GROUP REQUEST DEPENDS BASEDIR SLOT EVENTQUEUE SECRET HOSTHEADER
%token UID EUID GID MMONIT INSTANCE USERNAME PASSWORD %token UID EUID GID MMONIT INSTANCE USERNAME PASSWORD
%token TIME ATIME CTIME MTIME CHANGED MILLISECOND SECOND MINUTE HOUR DAY MONTH %token TIME ATIME CTIME MTIME CHANGED MILLISECOND SECOND MINUTE HOUR DAY MONTH
%token SSLAUTO SSLV2 SSLV3 TLSV1 TLSV11 TLSV12 TLSV13 CERTMD5 AUTO %token SSLAUTO SSLV2 SSLV3 TLSV1 TLSV11 TLSV12 TLSV13 CERTMD5 AUTO
%token BYTE KILOBYTE MEGABYTE GIGABYTE %token BYTE KILOBYTE MEGABYTE GIGABYTE
%token INODE SPACE TFREE PERMISSION SIZE MATCH NOT IGNORE ACTION UPTIME %token INODE SPACE TFREE PERMISSION SIZE MATCH NOT IGNORE ACTION UPTIME
%token EXEC UNMONITOR PING PING4 PING6 ICMP ICMPECHO NONEXIST EXIST INVALID DATA RECOVERED PASSED SUCCEEDED %token EXEC UNMONITOR PING PING4 PING6 ICMP ICMPECHO NONEXIST EXIST INVALID DATA RECOVERED PASSED SUCCEEDED
%token URL CONTENT PID PPID FSFLAG %token URL CONTENT PID PPID FSFLAG
%token REGISTER CREDENTIALS %token REGISTER CREDENTIALS
%token <url> URLOBJECT %token <url> URLOBJECT
skipping to change at line 617 skipping to change at line 617
} }
} }
; ;
setterminal : SET TERMINAL BATCH { setterminal : SET TERMINAL BATCH {
Run.flags |= Run_Batch; Run.flags |= Run_Batch;
} }
; ;
startdelay : /* EMPTY */ { startdelay : /* EMPTY */ {
$<number>$ = START_DELAY; $<number>$ = 0;
} }
| START DELAY NUMBER { | START DELAY NUMBER {
$<number>$ = $3; $<number>$ = $3;
} }
; ;
setinit : SET INIT { setinit : SET INIT {
Run.flags |= Run_Foreground; Run.flags |= Run_Foreground;
} }
; ;
skipping to change at line 1554 skipping to change at line 1554
} }
| PROTOCOL LDAP2 { | PROTOCOL LDAP2 {
portset.protocol = Protocol_get(Protocol_LDAP2); portset.protocol = Protocol_get(Protocol_LDAP2);
} }
| PROTOCOL LDAP3 { | PROTOCOL LDAP3 {
portset.protocol = Protocol_get(Protocol_LDAP3); portset.protocol = Protocol_get(Protocol_LDAP3);
} }
| PROTOCOL MONGODB { | PROTOCOL MONGODB {
portset.protocol = Protocol_get(Protocol_MONGODB); portset.protocol = Protocol_get(Protocol_MONGODB);
} }
| PROTOCOL MQTT mqttlist {
portset.protocol = Protocol_get(Protocol_MQTT);
}
| PROTOCOL MYSQL mysqllist { | PROTOCOL MYSQL mysqllist {
portset.protocol = Protocol_get(Protocol_MYSQL); portset.protocol = Protocol_get(Protocol_MYSQL);
} }
| PROTOCOL SIP siplist { | PROTOCOL SIP siplist {
portset.protocol = Protocol_get(Protocol_SIP); portset.protocol = Protocol_get(Protocol_SIP);
} }
| PROTOCOL NNTP { | PROTOCOL NNTP {
portset.protocol = Protocol_get(Protocol_NNTP); portset.protocol = Protocol_get(Protocol_NNTP);
} }
| PROTOCOL NTP3 { | PROTOCOL NTP3 {
skipping to change at line 1675 skipping to change at line 1678
; ;
smtp : username { smtp : username {
portset.parameters.smtp.username = $<string>1; portset.parameters.smtp.username = $<string>1;
} }
| password { | password {
portset.parameters.smtp.password = $<string>1; portset.parameters.smtp.password = $<string>1;
} }
; ;
mqttlist : /* EMPTY */
| mqttlist mqtt
;
mqtt : username {
portset.parameters.mqtt.username = $<string>1;
}
| password {
portset.parameters.mqtt.password = $<string>1;
}
;
mysqllist : /* EMPTY */ mysqllist : /* EMPTY */
| mysqllist mysql | mysqllist mysql
; ;
mysql : username { mysql : username {
if ($<string>1) { if ($<string>1) {
if (strlen($<string>1) > 16) if (strlen($<string>1) > 16)
yyerror2("Username too long -- Maximum M ySQL username length is 16 characters"); yyerror2("Username too long -- Maximum M ySQL username length is 16 characters");
else else
portset.parameters.mysql.username = $<st ring>1; portset.parameters.mysql.username = $<st ring>1;
skipping to change at line 2239 skipping to change at line 2254
} }
; ;
resourcechild : CHILDREN operator NUMBER { resourcechild : CHILDREN operator NUMBER {
resourceset.resource_id = Resource_Children; resourceset.resource_id = Resource_Children;
resourceset.operator = $<number>2; resourceset.operator = $<number>2;
resourceset.limit = $<number>3; resourceset.limit = $<number>3;
} }
; ;
resourceload : resourceloadavg operator value { resourceload : resourceloadavg coremultiplier operator value {
resourceset.resource_id = $<number>1; switch ($<number>1) {
resourceset.operator = $<number>2; case Resource_LoadAverage1m:
resourceset.limit = $<real>3; resourceset.resource_id = $<number>2 > 1
? Resource_LoadAveragePerCore1m : $<number>1;
break;
case Resource_LoadAverage5m:
resourceset.resource_id = $<number>2 > 1
? Resource_LoadAveragePerCore5m : $<number>1;
break;
case Resource_LoadAverage15m:
resourceset.resource_id = $<number>2 > 1
? Resource_LoadAveragePerCore15m : $<number>1;
break;
default:
resourceset.resource_id = $<number>1;
break;
}
resourceset.operator = $<number>3;
resourceset.limit = $<real>4;
} }
; ;
resourceloadavg : LOADAVG1 { $<number>$ = Resource_LoadAverage1m; } resourceloadavg : LOADAVG1 { $<number>$ = Resource_LoadAverage1m; }
| LOADAVG5 { $<number>$ = Resource_LoadAverage5m; } | LOADAVG5 { $<number>$ = Resource_LoadAverage5m; }
| LOADAVG15 { $<number>$ = Resource_LoadAverage15m; } | LOADAVG15 { $<number>$ = Resource_LoadAverage15m; }
; ;
coremultiplier : /* EMPTY */ { $<number>$ = 1; }
| CORE { $<number>$ = systeminfo.cpu.count; }
;
resourceread : DISK READ operator value unit currenttime { resourceread : DISK READ operator value unit currenttime {
resourceset.resource_id = Resource_ReadBytes; resourceset.resource_id = Resource_ReadBytes;
resourceset.operator = $<number>3; resourceset.operator = $<number>3;
resourceset.limit = $<real>4 * $<number>5; resourceset.limit = $<real>4 * $<number>5;
} }
| DISK READ operator NUMBER OPERATION { | DISK READ operator NUMBER OPERATION {
resourceset.resource_id = Resource_ReadOperations; resourceset.resource_id = Resource_ReadOperations;
resourceset.operator = $<number>3; resourceset.operator = $<number>3;
resourceset.limit = $<number>4; resourceset.limit = $<number>4;
} }
skipping to change at line 2927 skipping to change at line 2959
FREE(msg); FREE(msg);
} }
/* /*
* The Parser hook - start parsing the control file * The Parser hook - start parsing the control file
* Returns true if parsing succeeded, otherwise false * Returns true if parsing succeeded, otherwise false
*/ */
boolean_t parse(char *controlfile) { boolean_t parse(char *controlfile) {
ASSERT(controlfile); ASSERT(controlfile);
servicelist = tail = current = NULL;
if ((yyin = fopen(controlfile,"r")) == (FILE *)NULL) { if ((yyin = fopen(controlfile,"r")) == (FILE *)NULL) {
LogError("Cannot open the control file '%s' -- %s\n", controlfil e, STRERROR); LogError("Cannot open the control file '%s' -- %s\n", controlfil e, STRERROR);
return false; return false;
} }
currentfile = Str_dup(controlfile); currentfile = Str_dup(controlfile);
/* /*
* Creation of the global service list is synchronized * Creation of the global service list is synchronized
*/ */
skipping to change at line 2970 skipping to change at line 3000
return cfg_errflag == 0; return cfg_errflag == 0;
} }
/* ----------------------------------------------------------------- Private */ /* ----------------------------------------------------------------- Private */
/** /**
* Initialize objects used by the parser. * Initialize objects used by the parser.
*/ */
static void preparse() { static void preparse() {
servicelist = tail = current = NULL;
/* Set instance incarnation ID */ /* Set instance incarnation ID */
time(&Run.incarnation); time(&Run.incarnation);
/* Reset lexer */ /* Reset lexer */
buffer_stack_ptr = 0; buffer_stack_ptr = 0;
lineno = 1; lineno = 1;
arglineno = 1; arglineno = 1;
argcurrentfile = NULL; argcurrentfile = NULL;
argyytext = NULL; argyytext = NULL;
/* Reset parser */ /* Reset parser */
Run.limits.sendExpectBuffer = LIMIT_SENDEXPECTBUFFER; Run.limits.sendExpectBuffer = LIMIT_SENDEXPECTBUFFER;
skipping to change at line 3169 skipping to change at line 3200
current->program->args = command; current->program->args = command;
command = NULL; command = NULL;
current->program->timeout = Run.limits.programTimeout; current->program->timeout = Run.limits.programTimeout;
} }
/* Set default values */ /* Set default values */
current->mode = Monitor_Active; current->mode = Monitor_Active;
current->monitor = Monitor_Init; current->monitor = Monitor_Init;
current->onreboot = Run.onreboot; current->onreboot = Run.onreboot;
current->name = name; current->name = name;
current->name_escaped = Util_urlEncode(name, false);
current->check = check; current->check = check;
current->path = value; current->path = value;
/* Initialize general event handlers */ /* Initialize general event handlers */
addeventaction(&(current)->action_DATA, Action_Alert, Action_Ale rt); addeventaction(&(current)->action_DATA, Action_Alert, Action_Ale rt);
addeventaction(&(current)->action_EXEC, Action_Alert, Action_Ale rt); addeventaction(&(current)->action_EXEC, Action_Alert, Action_Ale rt);
addeventaction(&(current)->action_INVALID, Action_Restart, Action_Ale rt); addeventaction(&(current)->action_INVALID, Action_Restart, Action_Ale rt);
/* Initialize internal event handlers */ /* Initialize internal event handlers */
addeventaction(&(current)->action_ACTION, Action_Alert, Action_Ign ored); addeventaction(&(current)->action_ACTION, Action_Alert, Action_Ign ored);
skipping to change at line 3292 skipping to change at line 3324
g->members = List_new(); g->members = List_new();
g->next = servicegrouplist; g->next = servicegrouplist;
servicegrouplist = g; servicegrouplist = g;
} }
List_append(g->members, current); List_append(g->members, current);
} }
/* /*
* Add a dependant entry to the current service dependant list * Add a dependant entry to the current service dependant list
*
*/ */
static void adddependant(char *dependant) { static void adddependant(char *dependant) {
Dependant_T d; Dependant_T d;
ASSERT(dependant); ASSERT(dependant);
NEW(d); NEW(d);
if (current->dependantlist) if (current->dependantlist)
d->next = current->dependantlist; d->next = current->dependantlist;
d->dependant = dependant; d->dependant = dependant;
d->dependant_escaped = Util_urlEncode(dependant, false);
current->dependantlist = d; current->dependantlist = d;
} }
/* /*
* Add the given mailaddress with the appropriate alert notification * Add the given mailaddress with the appropriate alert notification
* values and mail attributes to the given mailinglist. * values and mail attributes to the given mailinglist.
*/ */
static void addmail(char *mailto, Mail_T f, Mail_T *l) { static void addmail(char *mailto, Mail_T f, Mail_T *l) {
Mail_T m; Mail_T m;
skipping to change at line 4696 skipping to change at line 4728
return result; return result;
} }
/* /*
* Check the dependency graph for errors * Check the dependency graph for errors
* by doing a topological sort, thereby finding any cycles. * by doing a topological sort, thereby finding any cycles.
* Assures that graph is a Directed Acyclic Graph (DAG). * Assures that graph is a Directed Acyclic Graph (DAG).
*/ */
static void check_depend() { static void check_depend() {
Service_T s;
Service_T depends_on = NULL; Service_T depends_on = NULL;
Service_T* dlt = &depend_list; /* the current tail of it */ Service_T* dlt = &depend_list; /* the current tail of it */
boolean_t done; /* no unvisited nodes left? */ boolean_t done; /* no unvisited nodes left? */
boolean_t found_some; /* last iteration found anything new ? */ boolean_t found_some; /* last iteration found anything new ? */
depend_list = NULL; /* depend_list will be the topological so rted servicelist */ depend_list = NULL; /* depend_list will be the topological so rted servicelist */
do { do {
done = true; done = true;
found_some = false; found_some = false;
for (s = servicelist; s; s = s->next) { for (Service_T s = servicelist; s; s = s->next) {
Dependant_T d; Dependant_T d;
if (s->visited) if (s->visited)
continue; continue;
done = false; // still unvisited nodes done = false; // still unvisited nodes
depends_on = NULL; depends_on = NULL;
for (d = s->dependantlist; d; d = d->next) { for (d = s->dependantlist; d; d = d->next) {
Service_T dp = Util_getService(d->dependant); Service_T dp = Util_getService(d->dependant);
if (! dp) { if (! dp) {
LogError("Depend service '%s' is not def ined in the control file\n", d->dependant); LogError("Depending service '%s' is not defined in the control file\n", d->dependant);
exit(1); exit(1);
} }
if (! dp->visited) { if (! dp->visited) {
depends_on = dp; depends_on = dp;
} }
} }
if (! depends_on) { if (! depends_on) {
s->visited = true; s->visited = true;
found_some = true; found_some = true;
skipping to change at line 4741 skipping to change at line 4772
if (! done) { if (! done) {
ASSERT(depends_on); ASSERT(depends_on);
LogError("Found a depend loop in the control file involving the service '%s'\n", depends_on->name); LogError("Found a depend loop in the control file involving the service '%s'\n", depends_on->name);
exit(1); exit(1);
} }
ASSERT(depend_list); ASSERT(depend_list);
servicelist = depend_list; servicelist = depend_list;
for (s = depend_list; s; s = s->next_depend) for (Service_T s = depend_list; s; s = s->next_depend)
s->next = s->next_depend; s->next = s->next_depend;
} }
/* /*
* Check if the executable exist * Check if the executable exist
*/ */
static void check_exec(char *exec) { static void check_exec(char *exec) {
if (! File_exist(exec)) if (! File_exist(exec))
yywarning2("Program does not exist:"); yywarning2("Program does not exist:");
else if (! File_isExecutable(exec)) else if (! File_isExecutable(exec))
 End of changes. 16 change blocks. 
14 lines changed or deleted 48 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)