How to send a notification

There are 3 options to send a notification:

  1. Via ZBXsend
  2. Via command line tools like curl
  3. Via REST in your own tools/applications
 

1. Via ZBXsend

 

  • Install ZBXsend (See ZBXsend page)
  • Adjust the configuration file
  • Call ZBXsend with your notification data as command line parameter
 

zbxsend \
	-i '<IDENTIFIER/INSTANCENAME>' \
	-a '<APITOKEN>' \
	-u '<APIKEY>' \
	-r '<RECIPIENTID>' \
	-e <EVENTID> \
	-s <STATUS> \
	-l <SEVERITY> \
	-t '<TITLE>' \
	-x '<TEXT>' \
	-n '<HOSTNAME>' \
	-g '<HOSTGROUP>' \
	-y '<HOSTTYPE>'

2. Via command line tools like curl

 

  • Open a terminal
  • Pass the right parameters to curl
 

curl -XPOST \
  https://api.zbxalert.com/v1/message \
  -H "X-ZBXalertAPI-Token: k7jR8HiKBsy9ciagqNz8rDg1ZAtRtHy5Sbg3dIHLBjtDa0allNQO9ehK5bjURblvdwTZrvqXq6vXMxvikbpHaX0NzknCe7pZxh8kQyzwozRtPnshvhbQfdPuixRxeLbA" \
  -H "X-API-KEY: Wlq4dTM1T32rfQq1Demoj6RazmKEYhi7FWcBTlK" \
  --data-urlencode recipient="52ababa5-9ca9-4a0a-8db7-b0de5ea960be" \
  --data-urlencode identifier="inst1" \
  --data-urlencode eventid=12363 \
  --data-urlencode state=1 \
  --data-urlencode severity=3 \
  --data-urlencode title="Test Title" \
  --data-urlencode text="Test Text" \
  --data-urlencode hostname="hostname1" \
  --data-urlencode hostgroup="hostgroup1" \
  --data-urlencode hosttype="hosttype1"

Via REST

You can send notifications with any script or application by calling our API with REST queries. Look in our API section for more information.