1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594
|
.\" Start URL macro. Copied from an-ext.tmac for portability
.de UR
. ds m1 \\$1\"
. nh
. if \\n(mH \{\
. \" Start diversion in a new environment.
. do ev URL-div
. do di URL-div
. \}
..
.\" End URL macro. Copied from an-ext.tmac for portability
.de UE
. ie \\n(mH \{\
. br
. di
. ev
.
. \" Has there been one or more input lines for the link text?
. ie \\n(dn \{\
. do HTML-NS "<a href=""\\*(m1"">"
. \" Yes, strip off final newline of diversion and emit it.
. do chop URL-div
. do URL-div
\c
. do HTML-NS </a>
. \}
. el \
. do HTML-NS "<a href=""\\*(m1"">\\*(m1</a>"
\&\\$*\"
. \}
. el \
\\*(la\\*(m1\\*(ra\\$*\"
.
. hy \\n(HY
..
.TH ZABBIX_SENDER 1 "2022\-01\-06" Zabbix
.if n .ad l
.SH NAME
zabbix_sender \- Zabbix sender utility
.SH SYNOPSIS
.B zabbix_sender
.RB [ \-v ]
.B \-z
.I server
.RB [ \-p
.IR port ]
.RB [ \-I
.IR IP\-address ]
.RB [ \-t
.IR timeout ]
.B \-s
.I host
.B \-k
.I key
.B \-o
.I value
.br
.B zabbix_sender
.RB [ \-v ]
.B \-z
.I server
.RB [ \-p
.IR port ]
.RB [ \-I
.IR IP\-address ]
.RB [ \-t
.IR timeout ]
.RB [ \-s
.IR host ]
.RB [ \-T ]
.RB [ \-N ]
.RB [ \-r ]
.B \-i
.I input\-file
.br
.B zabbix_sender
.RB [ \-v ]
.B \-c
.I config\-file
.RB [ \-z
.IR server ]
.RB [ \-p
.IR port ]
.RB [ \-I
.IR IP-address ]
.RB [ \-t
.IR timeout ]
.RB [ \-s
.IR host ]
.B \-k
.I key
.B \-o
.I value
.br
.B zabbix_sender
.RB [ \-v ]
.B \-c
.I config\-file
.RB [ \-z
.IR server ]
.RB [ \-p
.IR port ]
.RB [ \-I
.IR IP-address ]
.RB [ \-t
.IR timeout ]
.RB [ \-s
.IR host ]
.RB [ \-T ]
.RB [ \-N ]
.RB [ \-r ]
.B \-i
.I input-file
.br
.B zabbix_sender
.RB [ \-v ]
.B \-z
.I server
.RB [ \-p
.IR port ]
.RB [ \-I
.IR IP\-address ]
.RB [ \-t
.IR timeout ]
.B \-s
.I host
.B \-\-tls\-connect
.B cert
.B \-\-tls\-ca\-file
.I CA\-file
.RB [ \-\-tls\-crl\-file
.IR CRL\-file ]
.RB [ \-\-tls\-server\-cert\-issuer
.IR cert\-issuer ]
.RB [ \-\-tls\-server\-cert\-subject
.IR cert\-subject ]
.B \-\-tls\-cert\-file
.I cert\-file
.B \-\-tls\-key\-file
.I key\-file
.RB [ \-\-tls\-cipher13
.IR cipher\-string ]
.RB [ \-\-tls\-cipher
.IR cipher\-string ]
.B \-k
.I key
.B \-o
.I value
.br
.B zabbix_sender
.RB [ \-v ]
.B \-z
.I server
.RB [ \-p
.IR port ]
.RB [ \-I
.IR IP\-address ]
.RB [ \-t
.IR timeout ]
.RB [ \-s
.IR host ]
.B \-\-tls\-connect
.B cert
.B \-\-tls\-ca\-file
.I CA\-file
.RB [ \-\-tls\-crl\-file
.IR CRL\-file ]
.RB [ \-\-tls\-server\-cert\-issuer
.IR cert\-issuer ]
.RB [ \-\-tls\-server\-cert\-subject
.IR cert\-subject ]
.B \-\-tls\-cert\-file
.I cert\-file
.B \-\-tls\-key\-file
.I key\-file
.RB [ \-\-tls\-cipher13
.IR cipher\-string ]
.RB [ \-\-tls\-cipher
.IR cipher\-string ]
.RB [ \-T ]
.RB [ \-N ]
.RB [ \-r ]
.B \-i
.I input\-file
.br
.B zabbix_sender
.RB [ \-v ]
.B \-c
.I config-file
.RB [ \-z
.IR server ]
.RB [ \-p
.IR port ]
.RB [ \-I
.IR IP\-address ]
.RB [ \-t
.IR timeout ]
.RB [ \-s
.IR host ]
.B \-\-tls\-connect
.B cert
.B \-\-tls\-ca\-file
.I CA\-file
.RB [ \-\-tls\-crl\-file
.IR CRL\-file ]
.RB [ \-\-tls\-server\-cert\-issuer
.IR cert\-issuer ]
.RB [ \-\-tls\-server\-cert\-subject
.IR cert\-subject ]
.B \-\-tls\-cert\-file
.I cert\-file
.B \-\-tls\-key\-file
.I key\-file
.RB [ \-\-tls\-cipher13
.IR cipher\-string ]
.RB [ \-\-tls\-cipher
.IR cipher\-string ]
.B \-k
.I key
.B \-o
.I value
.br
.B zabbix_sender
.RB [ \-v ]
.B \-c
.I config-file
.RB [ \-z
.IR server ]
.RB [ \-p
.IR port ]
.RB [ \-I
.IR IP\-address ]
.RB [ \-t
.IR timeout ]
.RB [ \-s
.IR host ]
.B \-\-tls\-connect
.B cert
.B \-\-tls\-ca\-file
.I CA\-file
.RB [ \-\-tls\-crl\-file
.IR CRL\-file ]
.RB [ \-\-tls\-server\-cert\-issuer
.IR cert\-issuer ]
.RB [ \-\-tls\-server\-cert\-subject
.IR cert\-subject ]
.B \-\-tls\-cert\-file
.I cert\-file
.B \-\-tls\-key\-file
.I key\-file
.RB [ \-\-tls\-cipher13
.IR cipher\-string ]
.RB [ \-\-tls\-cipher
.IR cipher\-string ]
.RB [ \-T ]
.RB [ \-N ]
.RB [ \-r ]
.B \-i
.I input\-file
.br
.B zabbix_sender
.RB [ \-v ]
.B \-z
.I server
.RB [ \-p
.IR port ]
.RB [ \-I
.IR IP\-address ]
.RB [ \-t
.IR timeout ]
.B \-s
.I host
.B \-\-tls\-connect
.B psk
.B \-\-tls\-psk\-identity
.I PSK\-identity
.B \-\-tls\-psk\-file
.I PSK\-file
.RB [ \-\-tls\-cipher13
.IR cipher\-string ]
.RB [ \-\-tls\-cipher
.IR cipher\-string ]
.B \-k
.I key
.B \-o
.I value
.br
.B zabbix_sender
.RB [ \-v ]
.B \-z
.I server
.RB [ \-p
.IR port ]
.RB [ \-I
.IR IP\-address ]
.RB [ \-t
.IR timeout ]
.RB [ \-s
.IR host ]
.B \-\-tls\-connect
.B psk
.B \-\-tls\-psk\-identity
.I PSK\-identity
.B \-\-tls\-psk\-file
.I PSK\-file
.RB [ \-\-tls\-cipher13
.IR cipher\-string ]
.RB [ \-\-tls\-cipher
.IR cipher\-string ]
.RB [ \-T ]
.RB [ \-N ]
.RB [ \-r ]
.B \-i
.I input\-file
.br
.B zabbix_sender
.RB [ \-v ]
.B \-c
.I config\-file
.RB [ \-z
.IR server ]
.RB [ \-p
.IR port ]
.RB [ \-I
.IR IP-address ]
.RB [ \-t
.IR timeout ]
.RB [ \-s
.IR host ]
.B \-\-tls\-connect
.B psk
.B \-\-tls\-psk\-identity
.I PSK\-identity
.B \-\-tls\-psk\-file
.I PSK\-file
.RB [ \-\-tls\-cipher13
.IR cipher\-string ]
.RB [ \-\-tls\-cipher
.IR cipher\-string ]
.B \-k
.I key
.B \-o
.I value
.br
.B zabbix_sender
.RB [ \-v ]
.B \-c
.I config\-file
.RB [ \-z
.IR server ]
.RB [ \-p
.IR port ]
.RB [ \-I
.IR IP-address ]
.RB [ \-t
.IR timeout ]
.RB [ \-s
.IR host ]
.B \-\-tls\-connect
.B psk
.B \-\-tls\-psk\-identity
.I PSK\-identity
.B \-\-tls\-psk\-file
.I PSK\-file
.RB [ \-\-tls\-cipher13
.IR cipher\-string ]
.RB [ \-\-tls\-cipher
.IR cipher\-string ]
.RB [ \-T ]
.RB [ \-N ]
.RB [ \-r ]
.B \-i
.I input\-file
.br
.B zabbix_sender \-h
.br
.B zabbix_sender \-V
.SH DESCRIPTION
.B zabbix_sender
is a command line utility for sending monitoring data to Zabbix server or proxy.
On the Zabbix server an item of type \fBZabbix trapper\fR should be created with corresponding key.
Note that incoming values will only be accepted from hosts specified in \fBAllowed hosts\fR field for this item.
.SH OPTIONS
.IP "\fB\-c\fR, \fB\-\-config\fR \fIconfig\-file\fR"
Use \fIconfig\-file\fR.
\fBZabbix sender\fR reads server details from the agentd configuration file.
By default
.B Zabbix sender
does not read any configuration file.
Only parameters \fBHostname\fR, \fBServerActive\fR, \fBSourceIP\fR, \fBTLSConnect\fR, \fBTLSCAFile\fR, \fBTLSCRLFile\fR,
\fBTLSServerCertIssuer\fR, \fBTLSServerCertSubject\fR, \fBTLSCertFile\fR, \fBTLSKeyFile\fR, \fBTLSPSKIdentity\fR and \fBTLSPSKFile\fR are supported.
Hostname defined through \fBHostnameItem\fR parameter will not be picked up, in this case the hostname should be specified via command line (see -s option).
All addresses defined in the agent \fBServerActive\fR configuration parameter are used for sending data.
If sending of batch data fails to one address, the following batches are not sent to this address.
.IP "\fB\-z\fR, \fB\-\-zabbix\-server\fR \fIserver\fR"
Hostname or IP address of Zabbix server.
If a host is monitored by a proxy, proxy hostname or IP address should be used instead.
When used together with \fB\-\-config\fR, overrides the entries of \fBServerActive\fR parameter specified in agentd configuration file.
.IP "\fB\-p\fR, \fB\-\-port\fR \fIport\fR"
Specify port number of Zabbix server trapper running on the server.
Default is 10051.
When used together with \fB\-\-config\fR, overrides the port entries of \fBServerActive\fR parameter specified in agentd configuration file.
.IP "\fB\-I\fR, \fB\-\-source\-address\fR \fIIP\-address\fR"
Specify source IP address.
When used together with \fB\-\-config\fR, overrides \fBSourceIP\fR parameter specified in agentd configuration file.
.IP "\fB\-t\fR, \fB\-\-timeout\fR \fIseconds\fR"
Specify timeout. Valid range: 1\-300 seconds (default: 60)
.IP "\fB\-s\fR, \fB\-\-host\fR \fIhost\fR"
Specify host name the item belongs to (as registered in Zabbix frontend).
Host IP address and DNS name will not work.
When used together with \fB\-\-config\fR, overrides \fBHostname\fR parameter specified in agentd configuration file.
.IP "\fB\-k\fR, \fB\-\-key\fR \fIkey\fR"
Specify item key to send value to.
.IP "\fB\-o\fR, \fB\-\-value\fR \fIvalue\fR"
Specify item value.
.IP "\fB\-i\fR, \fB\-\-input\-file\fR \fIinput\-file\fR"
Load values from input file.
Specify \fB\-\fR as \fB<input-file>\fR to read values from standard input.
Each line of file contains whitespace delimited: \fB<hostname> <key> <value>\fR.
Each value must be specified on its own line. Each line must contain 3 whitespace delimited entries:
\fB<hostname> <key> <value>\fR, where "hostname" is the name of monitored host as registered in Zabbix frontend,
"key" is target item key and "value" \- the value to send. Specify \fB-\fR as \fB<hostname>\fR to use hostname from
agent configuration file or from \fB\-\-host\fR argument.
An example of a line of an input file:
\fB "Linux DB3" db.connections 43\fR
The value type must be correctly set in item configuration of Zabbix frontend.
Zabbix sender will send up to 250 values in one connection.
Contents of the input file must be in the UTF\-8 encoding.
All values from the input file are sent in a sequential order top\-down.
Entries must be formatted using the following rules:
.RS
.RS
.IP \[bu] 2
Quoted and non-quoted entries are supported.
.IP \[bu]
Double-quote is the quoting character.
.IP \[bu]
Entries with whitespace must be quoted.
.IP \[bu]
Double-quote and backslash characters inside quoted entry must be escaped with a backslash.
.IP \[bu]
Escaping is not supported in non-quoted entries.
.IP \[bu]
Linefeed escape sequences (\\n) are supported in quoted strings.
.IP \[bu]
Linefeed escape sequences are trimmed from the end of an entry.
.RE
.RE
.IP "\fB\-T\fR, \fB\-\-with\-timestamps\fR"
This option can be only used with \fB\-\-input\-file\fR option.
Each line of the input file must contain 4 whitespace delimited entries: \fB<hostname> <key> <timestamp> <value>\fR.
Timestamp should be specified in Unix timestamp format.
If target item has triggers referencing it, all timestamps must be in an increasing order, otherwise event calculation will not be correct.
An example of a line of the input file:
\fB "Linux DB3" db.connections 1429533600 43\fR
For more details please see option \fB\-\-input\-file\fR.
If a timestamped value is sent for a host that is in a “no data” maintenance type then this value will be dropped; however, it is possible to send a timestamped value in for an expired maintenance period and it will be accepted.
.IP "\fB\-N\fR, \fB\-\-with\-ns\fR"
This option can be only used with \fB\-\-with\-timestamps\fR option.
Each line of the input file must contain 5 whitespace delimited entries: \fB<hostname> <key> <timestamp> <ns> <value>\fR.
An example of a line of the input file:
\fB "Linux DB3" db.connections 1429533600 7402561 43\fR
For more details please see option \fB\-\-input\-file\fR.
.IP "\fB\-r\fR, \fB\-\-real\-time\fR"
Send values one by one as soon as they are received.
This can be used when reading from standard input.
.IP "\fB\-\-tls\-connect\fR \fIvalue\fR"
How to connect to server or proxy. Values:\fR
.SS
.RS 12
.TP 12
.B unencrypted
connect without encryption (default)
.RE
.RS 12
.TP 12
.B psk
connect using TLS and a pre-shared key
.RE
.RS 12
.TP 12
.B cert
connect using TLS and a certificate
.RE
.RE
.IP "\fB\-\-tls\-ca\-file\fR \fICA\-file\fR"
Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification.
.IP "\fB\-\-tls\-crl\-file\fR \fICRL\-file\fR"
Full pathname of a file containing revoked certificates.
.IP "\fB\-\-tls\-server\-cert\-issuer\fR \fIcert\-issuer\fR"
Allowed server certificate issuer.
.IP "\fB\-\-tls\-server\-cert\-subject\fR \fIcert\-subject\fR"
Allowed server certificate subject.
.IP "\fB\-\-tls\-cert\-file\fR \fIcert\-file\fR"
Full pathname of a file containing the certificate or certificate chain.
.IP "\fB\-\-tls\-key\-file\fR \fIkey\-file\fR"
Full pathname of a file containing the private key.
.IP "\fB\-\-tls\-psk\-identity\fR \fIPSK\-identity\fR"
PSK\-identity string.
.IP "\fB\-\-tls\-psk\-file\fR \fIPSK\-file\fR"
Full pathname of a file containing the pre-shared key.
.IP "\fB\-\-tls\-cipher13\fR \fIcipher\-string\fR"
Cipher string for OpenSSL 1.1.1 or newer for TLS 1.3. Override the default ciphersuite selection criteria. This option is not available if OpenSSL version is less than 1.1.1.
.IP "\fB\-\-tls\-cipher\fR \fIcipher\-string\fR"
GnuTLS priority string (for TLS 1.2 and up) or OpenSSL cipher string (only for TLS 1.2). Override the default ciphersuite selection criteria.
.IP "\fB\-v\fR, \fB\-\-verbose\fR"
Verbose mode, \fB\-vv\fR for more details.
.IP "\fB\-h\fR, \fB\-\-help\fR"
Display this help and exit.
.IP "\fB\-V\fR, \fB\-\-version\fR"
Output version information and exit.
.SH "EXIT STATUS"
The exit status is 0 if the values were sent and all of them were successfully processed by server.
If data was sent, but processing of at least one of the values failed, the exit status is 2.
If data sending failed, the exit status is 1.
.SH "EXAMPLES"
\fBzabbix_sender \-c /etc/zabbix/zabbix_agentd.conf \-k mysql.queries \-o 342.45\fR
.br
.RS
Send \fB342.45\fR as the value for \fBmysql.queries\fR item of monitored host. Use monitored host and Zabbix server defined in agent configuration file.
.RE
\fBzabbix_sender \-c /etc/zabbix/zabbix_agentd.conf \-s "Monitored Host" \-k mysql.queries \-o 342.45\fR
.br
.RS
Send \fB342.45\fR as the value for \fBmysql.queries\fR item of \fBMonitored Host\fR host using Zabbix server defined in agent configuration file.
.RE
.br
\fBzabbix_sender \-z 192.168.1.113 \-i data_values.txt\fR
.RS
.br
Send values from file \fBdata_values.txt\fR to Zabbix server with IP \fB192.168.1.113\fR.
Host names and keys are defined in the file.
.RE
.br
\fBecho "\- hw.serial.number 1287872261 SQ4321ASDF" | zabbix_sender \-c /etc/zabbix_agentd.conf \-T \-i \-\fR
.br
.RS
Send a timestamped value from the commandline to Zabbix server, specified in the agent configuration file.
Dash in the input data indicates that hostname also should be used from the same configuration file.
.RE
.br
\fBecho '"Zabbix server" trapper.item ""' | zabbix_sender \-z 192.168.1.113 \-p 10000 \-i \-\fR
.br
.RS
Send empty value of an item to the Zabbix server with IP address \fB192.168.1.113\fR on port \fB10000\fR from the commandline.
Empty values must be indicated by empty double quotes.
.RE
\fBzabbix_sender \-z 192.168.1.113 \-s "Monitored Host" \-k mysql.queries \-o 342.45 \-\-tls\-connect cert \-\-tls\-ca\-file /home/zabbix/zabbix_ca_file \-\-tls\-cert\-file /home/zabbix/zabbix_agentd.crt \-\-tls\-key\-file /home/zabbix/zabbix_agentd.key\fR
.br
.RS
Send \fB342.45\fR as the value for \fBmysql.queries\fR item in \fBMonitored Host\fR host to server with IP \fB192.168.1.113\fR using TLS with certificate.
.RE
\fBzabbix_sender \-z 192.168.1.113 \-s "Monitored Host" \-k mysql.queries \-o 342.45 \-\-tls\-connect psk \-\-tls\-psk\-identity "PSK ID Zabbix agentd" \-\-tls\-psk\-file /home/zabbix/zabbix_agentd.psk\fR
.br
.RS
Send \fB342.45\fR as the value for \fBmysql.queries\fR item in \fBMonitored Host\fR host to server with IP \fB192.168.1.113\fR using TLS with pre-shared key (PSK).
.RE
.SH "SEE ALSO"
.UR https://www.zabbix.com/manuals
Documentation
.UE
.PP
.BR zabbix_agentd (8),
.BR zabbix_get (1),
.BR zabbix_proxy (8),
.BR zabbix_server (8),
.BR zabbix_js (1),
.BR zabbix_agent2 (8),
.BR zabbix_web_service (8)
|