| 1 | package Plugin;
|
|---|
| 2 |
|
|---|
| 3 | message Common {
|
|---|
| 4 |
|
|---|
| 5 | enum ResultCode {
|
|---|
| 6 | OK = 0;
|
|---|
| 7 | WARNING = 1;
|
|---|
| 8 | CRITCAL = 2;
|
|---|
| 9 | UNKNOWN = 3;
|
|---|
| 10 | };
|
|---|
| 11 | enum DataType {
|
|---|
| 12 | INT = 1;
|
|---|
| 13 | STRING = 1;
|
|---|
| 14 | FLOAT = 1;
|
|---|
| 15 | BOOL = 1;
|
|---|
| 16 | };
|
|---|
| 17 |
|
|---|
| 18 | message AnyDataType {
|
|---|
| 19 | required Common.DataType type = 1;
|
|---|
| 20 | optional string string_data = 2;
|
|---|
| 21 | optional int64 int_data = 3;
|
|---|
| 22 | optional double float_data = 4;
|
|---|
| 23 | optional bool bool_data = 5;
|
|---|
| 24 | }
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 | enum Version {
|
|---|
| 28 | VERSION_1 = 1;
|
|---|
| 29 | };
|
|---|
| 30 |
|
|---|
| 31 | message Header {
|
|---|
| 32 | enum Type {
|
|---|
| 33 | QUERY_REQUEST = 1;
|
|---|
| 34 | QUERY_RESPONSE = 2;
|
|---|
| 35 |
|
|---|
| 36 | EXEC_REQUEST = 3;
|
|---|
| 37 | EXEC_RESPONSE = 4;
|
|---|
| 38 |
|
|---|
| 39 | LOG_MESSAGE = 5;
|
|---|
| 40 | };
|
|---|
| 41 | required Type type = 1;
|
|---|
| 42 | required Common.Version version = 2;
|
|---|
| 43 | optional Common.Version max_supported_version = 3;
|
|---|
| 44 |
|
|---|
| 45 | optional string sender = 17;
|
|---|
| 46 | optional string recipient = 18;
|
|---|
| 47 | optional int64 id = 19;
|
|---|
| 48 | };
|
|---|
| 49 |
|
|---|
| 50 | message PerformanceData {
|
|---|
| 51 | message IntValue {
|
|---|
| 52 | required int64 value = 1;
|
|---|
| 53 | optional string unit = 2;
|
|---|
| 54 | optional int64 warning = 3;
|
|---|
| 55 | optional int64 critical = 4;
|
|---|
| 56 | optional int64 minimum = 6;
|
|---|
| 57 | optional int64 maximum = 7;
|
|---|
| 58 | }
|
|---|
| 59 | message StringValue {
|
|---|
| 60 | required string value = 1;
|
|---|
| 61 | }
|
|---|
| 62 | message FloatValue {
|
|---|
| 63 | required double value = 1;
|
|---|
| 64 | optional string unit = 2;
|
|---|
| 65 | optional double warning = 3;
|
|---|
| 66 | optional double critical = 4;
|
|---|
| 67 | optional double minimum = 6;
|
|---|
| 68 | optional double maximum = 7;
|
|---|
| 69 | }
|
|---|
| 70 | message BoolValue {
|
|---|
| 71 | required bool value = 1;
|
|---|
| 72 | optional string unit = 2;
|
|---|
| 73 | optional bool warning = 3;
|
|---|
| 74 | optional bool critical = 4;
|
|---|
| 75 | }
|
|---|
| 76 | required string alias = 1;
|
|---|
| 77 | required Common.DataType type = 2;
|
|---|
| 78 | optional IntValue int_value = 3;
|
|---|
| 79 | optional StringValue string_value = 4;
|
|---|
| 80 | optional FloatValue float_value = 5;
|
|---|
| 81 | optional BoolValue bool_value = 6;
|
|---|
| 82 |
|
|---|
| 83 | // TODO add thresholds here!
|
|---|
| 84 | }
|
|---|
| 85 | };
|
|---|
| 86 |
|
|---|
| 87 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 88 | //
|
|---|
| 89 | // Query request/response
|
|---|
| 90 | // Used for querying the client this is the "normal" check_nrpe thingy
|
|---|
| 91 | //
|
|---|
| 92 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 93 |
|
|---|
| 94 | message QueryRequestMessage {
|
|---|
| 95 | message Request {
|
|---|
| 96 | optional int32 id = 1;
|
|---|
| 97 | required string command = 2;
|
|---|
| 98 | repeated string arguments = 3;
|
|---|
| 99 | };
|
|---|
| 100 |
|
|---|
| 101 | required Common.Header header = 1;
|
|---|
| 102 | repeated Request payload = 2;
|
|---|
| 103 | }
|
|---|
| 104 | message QueryResponseMessage {
|
|---|
| 105 |
|
|---|
| 106 | message Response {
|
|---|
| 107 |
|
|---|
| 108 | optional int32 id = 1;
|
|---|
| 109 | required string command = 2;
|
|---|
| 110 | repeated string arguments = 16;
|
|---|
| 111 |
|
|---|
| 112 | required Common.ResultCode result = 3;
|
|---|
| 113 | required string message = 4;
|
|---|
| 114 | optional string legacyPerf = 17;
|
|---|
| 115 | repeated Common.PerformanceData perf = 5;
|
|---|
| 116 |
|
|---|
| 117 | }
|
|---|
| 118 |
|
|---|
| 119 | required Common.Header header = 1;
|
|---|
| 120 | repeated Response payload = 2;
|
|---|
| 121 | }
|
|---|
| 122 |
|
|---|
| 123 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 124 | //
|
|---|
| 125 | // Log Entry
|
|---|
| 126 | // Used for sending errors and log entries to a logging module
|
|---|
| 127 | // (this is internal errors, not syslog or eventlog)
|
|---|
| 128 | //
|
|---|
| 129 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 130 |
|
|---|
| 131 | message LogEntry {
|
|---|
| 132 | message Entry {
|
|---|
| 133 | enum Level {
|
|---|
| 134 | LOG_DEBUG = 0;
|
|---|
| 135 | LOG_INFO = 10;
|
|---|
| 136 | LOG_WARNING = 20;
|
|---|
| 137 | LOG_ERROR = 30;
|
|---|
| 138 | LOG_CRITICAL = 40;
|
|---|
| 139 | };
|
|---|
| 140 | required Level level = 1;
|
|---|
| 141 | optional string sender = 2;
|
|---|
| 142 | optional string file = 3;
|
|---|
| 143 | optional int32 line = 4;
|
|---|
| 144 | optional string message = 5;
|
|---|
| 145 | optional int32 date = 6;
|
|---|
| 146 | };
|
|---|
| 147 |
|
|---|
| 148 | repeated Entry entry = 1;
|
|---|
| 149 | }
|
|---|
| 150 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 151 | //
|
|---|
| 152 | // Execute command request and response
|
|---|
| 153 | // Used for executing commands on clients
|
|---|
| 154 | //
|
|---|
| 155 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 156 |
|
|---|
| 157 | message ExecuteRequestMessage {
|
|---|
| 158 | message Request {
|
|---|
| 159 | optional int32 id = 1;
|
|---|
| 160 | required string command = 2;
|
|---|
| 161 | repeated string arguments = 3;
|
|---|
| 162 | };
|
|---|
| 163 |
|
|---|
| 164 | required Common.Header header = 1;
|
|---|
| 165 | repeated Request payload = 2;
|
|---|
| 166 | }
|
|---|
| 167 | message ExecuteResponseMessage {
|
|---|
| 168 | message Response {
|
|---|
| 169 |
|
|---|
| 170 | message ResponseData {
|
|---|
| 171 | message ResponseDataCell {
|
|---|
| 172 | required Common.AnyDataType data = 1;
|
|---|
| 173 | optional string tag = 2;
|
|---|
| 174 | }
|
|---|
| 175 | message ResponseDataRow {
|
|---|
| 176 | repeated ResponseDataCell cells = 1;
|
|---|
| 177 | }
|
|---|
| 178 | required string alias = 1;
|
|---|
| 179 | optional ResponseDataRow headers = 2;
|
|---|
| 180 | repeated ResponseDataRow rows = 3;
|
|---|
| 181 |
|
|---|
| 182 | }
|
|---|
| 183 |
|
|---|
| 184 | optional int32 id = 2;
|
|---|
| 185 | required string command = 5;
|
|---|
| 186 | repeated string arguments = 16;
|
|---|
| 187 |
|
|---|
| 188 | required Common.ResultCode result = 9;
|
|---|
| 189 | required string message = 10;
|
|---|
| 190 |
|
|---|
| 191 | optional ResponseData data = 11;
|
|---|
| 192 |
|
|---|
| 193 | }
|
|---|
| 194 | required Common.Header header = 1;
|
|---|
| 195 | repeated Response payload = 2;
|
|---|
| 196 | }
|
|---|
| 197 |
|
|---|
| 198 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 199 | //
|
|---|
| 200 | // Submit result
|
|---|
| 201 | // Used for submitting a passive result
|
|---|
| 202 | //
|
|---|
| 203 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 204 |
|
|---|
| 205 | message SubmitResponseMessage {
|
|---|
| 206 | required Common.Header header = 1;
|
|---|
| 207 | repeated QueryResponseMessage.Response payload = 2;
|
|---|
| 208 | }
|
|---|
| 209 |
|
|---|
| 210 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 211 | //
|
|---|
| 212 | // Settings commands
|
|---|
| 213 | // Used for accessing the settings store
|
|---|
| 214 | //
|
|---|
| 215 | // // // // // // // // // // // // // // // // // // // // // // // //
|
|---|
| 216 | message Settings {
|
|---|
| 217 | message Node {
|
|---|
| 218 | message Path {
|
|---|
| 219 | required string path = 1;
|
|---|
| 220 | optional string key = 2;
|
|---|
| 221 | }
|
|---|
| 222 | optional Path path = 1;
|
|---|
| 223 | optional string expression = 2;
|
|---|
| 224 | };
|
|---|
| 225 | };
|
|---|
| 226 |
|
|---|
| 227 | message QuerySettingsRequestMessage {
|
|---|
| 228 | message Request {
|
|---|
| 229 | optional int64 id = 1;
|
|---|
| 230 | required Settings node = 2;
|
|---|
| 231 |
|
|---|
| 232 | optional string default = 3;
|
|---|
| 233 | optional bool fetch_descriptions = 4;
|
|---|
| 234 |
|
|---|
| 235 | optional Common.DataType return_type = 17;
|
|---|
| 236 |
|
|---|
| 237 | };
|
|---|
| 238 | required Common.Header header = 1;
|
|---|
| 239 | repeated Request payload = 2;
|
|---|
| 240 | }
|
|---|
| 241 | message QuerySettingsResponseMessage {
|
|---|
| 242 | message Response {
|
|---|
| 243 | message SectionKeys {
|
|---|
| 244 | repeated string key = 1;
|
|---|
| 245 | }
|
|---|
| 246 | optional int64 id = 1;
|
|---|
| 247 | required Settings node = 2;
|
|---|
| 248 |
|
|---|
| 249 | optional Common.AnyDataType value = 4;
|
|---|
| 250 | optional SectionKeys keys = 5;
|
|---|
| 251 |
|
|---|
| 252 | optional string title = 6;
|
|---|
| 253 | optional string description = 7;
|
|---|
| 254 |
|
|---|
| 255 | optional Common.DataType required_type = 17;
|
|---|
| 256 |
|
|---|
| 257 | };
|
|---|
| 258 | required Common.Header header = 1;
|
|---|
| 259 | repeated Response payload = 2;
|
|---|
| 260 | }
|
|---|
| 261 |
|
|---|