| 1 | package Plugin;
|
|---|
| 2 |
|
|---|
| 3 | option optimize_for = LITE_RUNTIME;
|
|---|
| 4 |
|
|---|
| 5 | message Common {
|
|---|
| 6 |
|
|---|
| 7 | enum ResultCode {
|
|---|
| 8 | OK = 0;
|
|---|
| 9 | WARNING = 1;
|
|---|
| 10 | CRITCAL = 2;
|
|---|
| 11 | UNKNOWN = 3;
|
|---|
| 12 | };
|
|---|
| 13 | enum DataType {
|
|---|
| 14 | INT = 1;
|
|---|
| 15 | STRING = 1;
|
|---|
| 16 | FLOAT = 1;
|
|---|
| 17 | BOOL = 1;
|
|---|
| 18 | };
|
|---|
| 19 |
|
|---|
| 20 | message AnyDataType {
|
|---|
| 21 | required Common.DataType type = 1;
|
|---|
| 22 | optional string string_data = 2;
|
|---|
| 23 | optional int64 int_data = 3;
|
|---|
| 24 | optional double float_data = 4;
|
|---|
| 25 | optional bool bool_data = 5;
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | message KeyValue {
|
|---|
| 29 | required string key = 1;
|
|---|
| 30 | required string value = 2;
|
|---|
| 31 | repeated string data = 3;
|
|---|
| 32 | }
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 | enum Version {
|
|---|
| 36 | VERSION_1 = 1;
|
|---|
| 37 | };
|
|---|
| 38 |
|
|---|
| 39 | message Host {
|
|---|
| 40 |
|
|---|
| 41 | optional string id = 1;
|
|---|
| 42 | optional string host = 2;
|
|---|
| 43 | optional string address = 3;
|
|---|
| 44 | optional string protocol = 4;
|
|---|
| 45 | optional string comment = 5;
|
|---|
| 46 |
|
|---|
| 47 | repeated Common.KeyValue metadata = 6;
|
|---|
| 48 | repeated string tags = 7;
|
|---|
| 49 | };
|
|---|
| 50 |
|
|---|
| 51 | message Header {
|
|---|
| 52 |
|
|---|
| 53 | required Common.Version version = 1;
|
|---|
| 54 | optional Common.Version max_supported_version = 2;
|
|---|
| 55 |
|
|---|
| 56 | optional string source_id = 3;
|
|---|
| 57 | optional string sender_id = 4;
|
|---|
| 58 | optional string recipient_id = 5;
|
|---|
| 59 | optional string destination_id = 6;
|
|---|
| 60 |
|
|---|
| 61 | optional int64 message_id = 16;
|
|---|
| 62 |
|
|---|
| 63 | repeated Common.KeyValue metadata = 8;
|
|---|
| 64 | repeated string tags = 9;
|
|---|
| 65 |
|
|---|
| 66 | repeated Host hosts = 10;
|
|---|
| 67 | };
|
|---|
| 68 |
|
|---|
| 69 | message Attachment {
|
|---|
| 70 |
|
|---|
| 71 | optional int64 id = 1;
|
|---|
| 72 | required string type = 2;
|
|---|
| 73 | repeated Common.KeyValue metadata = 3;
|
|---|
| 74 | repeated string tags = 4;
|
|---|
| 75 | required string data = 5;
|
|---|
| 76 | };
|
|---|
| 77 |
|
|---|
| 78 | message PerformanceData {
|
|---|
| 79 | message IntValue {
|
|---|
| 80 | required int64 value = 1;
|
|---|
| 81 | optional string unit = 2;
|
|---|
| 82 | optional int64 warning = 3;
|
|---|
| 83 | optional int64 critical = 4;
|
|---|
| 84 | optional int64 minimum = 6;
|
|---|
| 85 | optional int64 maximum = 7;
|
|---|
| 86 | }
|
|---|
| 87 | message StringValue {
|
|---|
| 88 | required string value = 1;
|
|---|
| 89 | }
|
|---|
| 90 | message FloatValue {
|
|---|
| 91 | required double value = 1;
|
|---|
| 92 | optional string unit = 2;
|
|---|
| 93 | optional double warning = 3;
|
|---|
| 94 | optional double critical = 4;
|
|---|
| 95 | optional double minimum = 6;
|
|---|
| 96 | optional double maximum = 7;
|
|---|
| 97 | }
|
|---|
| 98 | message BoolValue {
|
|---|
| 99 | required bool value = 1;
|
|---|
| 100 | optional string unit = 2;
|
|---|
| 101 | optional bool warning = 3;
|
|---|
| 102 | optional bool critical = 4;
|
|---|
| 103 | }
|
|---|
| 104 | required string alias = 1;
|
|---|
| 105 | required Common.DataType type = 2;
|
|---|
| 106 | optional IntValue int_value = 3;
|
|---|
| 107 | optional StringValue string_value = 4;
|
|---|
| 108 | optional FloatValue float_value = 5;
|
|---|
| 109 | optional BoolValue bool_value = 6;
|
|---|
| 110 |
|
|---|
| 111 | // TODO add thresholds here!
|
|---|
| 112 | }
|
|---|
| 113 |
|
|---|
| 114 | message Status {
|
|---|
| 115 |
|
|---|
| 116 | enum StatusType {
|
|---|
| 117 | OK = 0;
|
|---|
| 118 | WARNING = 1;
|
|---|
| 119 | PROBLEM = 2;
|
|---|
| 120 | CRITICAL = 3;
|
|---|
| 121 | UNKNOWN = 10;
|
|---|
| 122 | };
|
|---|
| 123 |
|
|---|
| 124 | required StatusType status = 1;
|
|---|
| 125 | optional string message = 2;
|
|---|
| 126 | optional string data = 3;
|
|---|
| 127 | }
|
|---|
| 128 |
|
|---|
| 129 | };
|
|---|
| 130 |
|
|---|
| 131 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 132 | //
|
|---|
| 133 | // Query request/response
|
|---|
| 134 | // Used for querying the client this is the "normal" check_nrpe thingy
|
|---|
| 135 | //
|
|---|
| 136 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 137 |
|
|---|
| 138 | message QueryRequestMessage {
|
|---|
| 139 | message Request {
|
|---|
| 140 | optional int32 id = 1;
|
|---|
| 141 | optional string target = 7;
|
|---|
| 142 | required string command = 2;
|
|---|
| 143 | optional string alias = 3;
|
|---|
| 144 | repeated string arguments = 4;
|
|---|
| 145 | repeated Common.Attachment attachments = 17;
|
|---|
| 146 | };
|
|---|
| 147 |
|
|---|
| 148 | required Common.Header header = 1;
|
|---|
| 149 | repeated Request payload = 2;
|
|---|
| 150 | repeated Common.Attachment attachments = 3;
|
|---|
| 151 | }
|
|---|
| 152 | message QueryResponseMessage {
|
|---|
| 153 |
|
|---|
| 154 | message Response {
|
|---|
| 155 |
|
|---|
| 156 | optional int32 id = 1;
|
|---|
| 157 | optional string source = 7;
|
|---|
| 158 | required string command = 2;
|
|---|
| 159 | optional string alias = 3;
|
|---|
| 160 | repeated string arguments = 16;
|
|---|
| 161 |
|
|---|
| 162 | required Common.ResultCode result = 4;
|
|---|
| 163 | required string message = 5;
|
|---|
| 164 | repeated Common.PerformanceData perf = 6;
|
|---|
| 165 | repeated Common.Attachment attachments = 17;
|
|---|
| 166 |
|
|---|
| 167 | }
|
|---|
| 168 |
|
|---|
| 169 | required Common.Header header = 1;
|
|---|
| 170 | repeated Response payload = 2;
|
|---|
| 171 | repeated Common.Attachment attachments = 3;
|
|---|
| 172 | }
|
|---|
| 173 |
|
|---|
| 174 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 175 | //
|
|---|
| 176 | // Execute command request and response
|
|---|
| 177 | // Used for executing commands on clients
|
|---|
| 178 | //
|
|---|
| 179 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 180 |
|
|---|
| 181 | message ExecuteRequestMessage {
|
|---|
| 182 | message Request {
|
|---|
| 183 | optional int32 id = 1;
|
|---|
| 184 | required string command = 2;
|
|---|
| 185 | repeated string arguments = 3;
|
|---|
| 186 | repeated Common.Attachment attachments = 17;
|
|---|
| 187 | };
|
|---|
| 188 |
|
|---|
| 189 | required Common.Header header = 1;
|
|---|
| 190 | repeated Request payload = 2;
|
|---|
| 191 | repeated Common.Attachment attachments = 3;
|
|---|
| 192 | }
|
|---|
| 193 | message ExecuteResponseMessage {
|
|---|
| 194 | message Response {
|
|---|
| 195 |
|
|---|
| 196 | message ResponseData {
|
|---|
| 197 | message ResponseDataCell {
|
|---|
| 198 | required Common.AnyDataType data = 1;
|
|---|
| 199 | optional string tag = 2;
|
|---|
| 200 | }
|
|---|
| 201 | message ResponseDataRow {
|
|---|
| 202 | repeated ResponseDataCell cells = 1;
|
|---|
| 203 | }
|
|---|
| 204 | required string alias = 1;
|
|---|
| 205 | optional ResponseDataRow headers = 2;
|
|---|
| 206 | repeated ResponseDataRow rows = 3;
|
|---|
| 207 |
|
|---|
| 208 | }
|
|---|
| 209 |
|
|---|
| 210 | optional int32 id = 2;
|
|---|
| 211 | required string command = 5;
|
|---|
| 212 | repeated string arguments = 16;
|
|---|
| 213 |
|
|---|
| 214 | required Common.ResultCode result = 9;
|
|---|
| 215 | required string message = 10;
|
|---|
| 216 |
|
|---|
| 217 | optional ResponseData data = 11;
|
|---|
| 218 | repeated Common.Attachment attachments = 17;
|
|---|
| 219 |
|
|---|
| 220 | }
|
|---|
| 221 | required Common.Header header = 1;
|
|---|
| 222 | repeated Response payload = 2;
|
|---|
| 223 | repeated Common.Attachment attachments = 3;
|
|---|
| 224 | }
|
|---|
| 225 |
|
|---|
| 226 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 227 | //
|
|---|
| 228 | // Submit result
|
|---|
| 229 | // Used for submitting a passive result
|
|---|
| 230 | //
|
|---|
| 231 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 232 |
|
|---|
| 233 | message SubmitRequestMessage {
|
|---|
| 234 | required Common.Header header = 1;
|
|---|
| 235 | required string channel = 2;
|
|---|
| 236 | repeated QueryResponseMessage.Response payload = 3;
|
|---|
| 237 | repeated Common.Attachment attachments = 4;
|
|---|
| 238 | }
|
|---|
| 239 |
|
|---|
| 240 | message SubmitResponseMessage {
|
|---|
| 241 | message Response {
|
|---|
| 242 | optional int32 id = 1;
|
|---|
| 243 | required string command = 2;
|
|---|
| 244 | required Common.Status status = 3;
|
|---|
| 245 | repeated Common.Attachment attachments = 17;
|
|---|
| 246 | };
|
|---|
| 247 | required Common.Header header = 1;
|
|---|
| 248 | repeated Response payload = 2;
|
|---|
| 249 | repeated Common.Attachment attachments = 3;
|
|---|
| 250 | }
|
|---|
| 251 |
|
|---|
| 252 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 253 | //
|
|---|
| 254 | // Settings commands
|
|---|
| 255 | // Used for accessing the settings store
|
|---|
| 256 | //
|
|---|
| 257 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 258 | message Settings {
|
|---|
| 259 | message Node {
|
|---|
| 260 | message Path {
|
|---|
| 261 | required string path = 1;
|
|---|
| 262 | optional string key = 2;
|
|---|
| 263 | }
|
|---|
| 264 | optional Path path = 1;
|
|---|
| 265 | optional string expression = 2;
|
|---|
| 266 | };
|
|---|
| 267 | };
|
|---|
| 268 |
|
|---|
| 269 | message QuerySettingsRequestMessage {
|
|---|
| 270 | message Request {
|
|---|
| 271 | optional int64 id = 1;
|
|---|
| 272 | required Settings node = 2;
|
|---|
| 273 |
|
|---|
| 274 | optional string default = 3;
|
|---|
| 275 | optional bool fetch_descriptions = 4;
|
|---|
| 276 |
|
|---|
| 277 | optional Common.DataType return_type = 17;
|
|---|
| 278 |
|
|---|
| 279 | };
|
|---|
| 280 | required Common.Header header = 1;
|
|---|
| 281 | repeated Request payload = 2;
|
|---|
| 282 | }
|
|---|
| 283 | message QuerySettingsResponseMessage {
|
|---|
| 284 | message Response {
|
|---|
| 285 | message SectionKeys {
|
|---|
| 286 | repeated string key = 1;
|
|---|
| 287 | }
|
|---|
| 288 | optional int64 id = 1;
|
|---|
| 289 | required Settings node = 2;
|
|---|
| 290 |
|
|---|
| 291 | optional Common.AnyDataType value = 4;
|
|---|
| 292 | optional SectionKeys keys = 5;
|
|---|
| 293 |
|
|---|
| 294 | optional string title = 6;
|
|---|
| 295 | optional string description = 7;
|
|---|
| 296 |
|
|---|
| 297 | optional Common.DataType required_type = 17;
|
|---|
| 298 |
|
|---|
| 299 | };
|
|---|
| 300 | required Common.Header header = 1;
|
|---|
| 301 | repeated Response payload = 2;
|
|---|
| 302 | }
|
|---|
| 303 |
|
|---|
| 304 |
|
|---|
| 305 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 306 | //
|
|---|
| 307 | // Log Entry
|
|---|
| 308 | // Used for sending errors and log entries to a logging module
|
|---|
| 309 | // (this is internal errors, not syslog or eventlog)
|
|---|
| 310 | //
|
|---|
| 311 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 312 |
|
|---|
| 313 | message LogEntry {
|
|---|
| 314 | message Entry {
|
|---|
| 315 | enum Level {
|
|---|
| 316 | LOG_DEBUG = 500;
|
|---|
| 317 | LOG_INFO = 150;
|
|---|
| 318 | LOG_WARNING = 50;
|
|---|
| 319 | LOG_ERROR = 10;
|
|---|
| 320 | LOG_CRITICAL = 1;
|
|---|
| 321 | };
|
|---|
| 322 | required Level level = 1;
|
|---|
| 323 | optional string sender = 2;
|
|---|
| 324 | optional string file = 3;
|
|---|
| 325 | optional int32 line = 4;
|
|---|
| 326 | optional string message = 5;
|
|---|
| 327 | optional int32 date = 6;
|
|---|
| 328 | };
|
|---|
| 329 |
|
|---|
| 330 | repeated Entry entry = 1;
|
|---|
| 331 | } |
|---|