summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f6b9d3b)
raw | patch | inline | side by side (parent: f6b9d3b)
author | John-John Tedro <johnjohn.tedro@gmail.com> | |
Mon, 2 Sep 2013 21:30:51 +0000 (21:30 +0000) | ||
committer | John-John Tedro <johnjohn.tedro@gmail.com> | |
Mon, 2 Sep 2013 21:30:51 +0000 (21:30 +0000) |
src/utils_cmd_putnotif.c | patch | blob | history | |
src/utils_parse_option.c | patch | blob | history |
index 5a9faff2321e315188e370c7b5508fb17a108576..af9cf0e87af48111c346d9408e968ec789763788 100644 (file)
--- a/src/utils_cmd_putnotif.c
+++ b/src/utils_cmd_putnotif.c
DEBUG ("utils_cmd_putnotif: set_option (option = %s, value = %s);",
option, value);
+ /* Add a meta option in the form: <type>:<key> */
+ if (option[0] != '\0' && option[1] == ':') {
+ /* Refuse empty key */
+ if (option[2] == '\0')
+ return (1);
+
+ if (option[0] == 's')
+ return plugin_notification_meta_add_string (n, option + 2, value);
+ else
+ return (1);
+ }
+
if (strcasecmp ("severity", option) == 0)
return (set_option_severity (n, value));
else if (strcasecmp ("time", option) == 0)
index 820f14f58ef1da32cdfbe73c016c7fefdba4a0b0..8086d63fc0ee669419c943690c36474ccff926b6 100644 (file)
--- a/src/utils_parse_option.c
+++ b/src/utils_parse_option.c
/* Look for the equal sign */
buffer = key;
- while (isalnum ((int) *buffer) || *buffer == '_')
+ while (isalnum ((int) *buffer) || *buffer == '_' || *buffer == ':')
buffer++;
if ((*buffer != '=') || (buffer == key))
return (1);