Ad Widget

Collapse

How to send only few results from the python script to Zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Supriya123
    Junior Member
    • Jun 2019
    • 17

    #1

    How to send only few results from the python script to Zabbix

    Hi All,

    I really need help. I am new to Zabbix. Today I got the requirement that we have one python script and the script results large amount of data, But to send it Zabbix we need only few results from the script to send it to Zabbix. is there any way. Here is my python script output

    Response

    SIP/2.0 401 Unauthorized

    Via: SIP/2.0/udp :38111;rport=38111;received=

    From: <sip:watchdog@>

    To: <sip:watchdog@>;tag=

    Call-ID: 2444433068820031524

    CSeq: 1563468282 REGISTER

    WWW-Authenticate: Digest realm="", nonce=""

    Content-Length: 0

    Response Register

    REGISTER SIP/2.0

    Via: SIP/2.0/udp :38111

    From: <sip:watchdog@>

    To: <sip:watchdog@>

    Contact: <sip:watchdog@:38111>;events="message-summary"

    Call-ID: 2444433068820031524

    CSeq: 1563468282 REGISTER

    Expires: 60

    User-Agent:

    Max-Forwards: 70

    Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SU BSCRIBE

    Authorization: Digest username="watchdog", realm="", algorithm=md5, uri="", nonce="", response=""

    Content-Length: 0







    Login response

    SIP/2.0 200 OK

    Via: SIP/2.0/udp xx.xxx.xx:38111;rport=38111;received=xx.xx.xxx

    From: <sip:watchdog@>

    To: <sip:watchdog@>;tag=
    Call-ID: 2444433068820031524

    CSeq: 1563468282 REGISTER

    Date: Thu, 18 Jul 2019 16:44:42 GMT

    Contact: <sip:[email protected]:38111>;q=0.1;expires=60;re ceived="sip:xx.xx.xxx:38111;dstip=10.11.3.24;dstpo rt=6250"

    Content-Length: 0







    return status

    200 OK

    success True

    SER is active

    ******Something went wrong with this SER]


    This is all the response that we get from script, Is there any way in Zabbix we can filter the output and get only some data like
    return status

    200 OK

    success True

    SER is active

    I tried placing the script using UserParameter and ran it, but it results whole bunch of output, which I don't want, so asking if there any other way.

    I really appreciate your help.
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2

    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
    https://kloczek.wordpress.com/
    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
    My zabbix templates https://github.com/kloczek/zabbix-templates

    Comment

    • Supriya123
      Junior Member
      • Jun 2019
      • 17

      #3
      Hi,
      I tried using trappers, but I didn't understand how to automate this.

      zabbix_sender -z xx.xx.xxx -p 10051 -s /etc/zabbix/zabbix_agentd.conf -k status -o "ok"

      info from server: "processed: 0; failed: 1; total: 1; seconds spent: 0.000115"

      sent: 1; skipped: 0; total: 1

      I also created trapper in UI, but I got the error

      Cannot send request: wrong item type.

      Can you please help me? Am I missing anything here

      Comment

      • bitmeup
        Junior Member
        • Apr 2018
        • 18

        #4

        To answer the original question, you should change the script to get only the individual pieces of data that you want to send to zabbix. From what I recall, there is no pipeline feature in Zabbix that will allow you to split parts of bulk data.

        For completion, you can check an example of what I did in this post

        Comment

        Working...