Ad Widget

Collapse

Setting Up SNMP Traps in Zabbix - Need Step-by-Step Guidance

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anarose192
    Junior Member
    • Nov 2023
    • 1

    #1

    Setting Up SNMP Traps in Zabbix - Need Step-by-Step Guidance

    I'm currently working on integrating SNMP traps into my Zabbix monitoring setup, but I'm facing some challenges with the configuration. I've reviewed the Zabbix documentation, but I'm still having trouble getting it to work properly. Could someone kindly provide a step-by-step guide or walkthrough on how to properly set up SNMP traps within Zabbix? Any specific configurations, traps receivers, or best practices would be greatly appreciated.
  • postowy-zabbix
    Junior Member
    • Sep 2022
    • 3

    #2

    https://www.zabbix.com/documentation...types/snmptrap


    https://blog.zabbix.com/snmp-traps-in-zabbix/8210/

    https://blog.zabbix.com/parsing-snmp...rnative/11577/




    Comment

    • Somi Singh
      Junior Member
      • Nov 2023
      • 1

      #3
      Hi, I'm currently working on Zabbix API to get SNMP details, although I'm getting all details through snmp walk command and on zabbix too,but not with Zabbix API, is there any limitation which zabbix offers with zabbix api? If yes, how can I disable it, because I need complete SNMP information using API.
      import json
      import requests
      API_URL = "http://localhost/api_jsonrpc.php"
      USERNAME = "xxxx"
      PASSWORD = "xxxxx"
      def authenticate():
      payload = {
      'jsonrpc': '2.0',
      'method': 'user.login',
      'params': {
      'username': USERNAME,
      'password': PASSWORD,
      },
      'id': 1,
      }
      response = requests.post(API_URL, json=payload)
      auth_result = response.json()
      return auth_result['result']
      def main():
      file = "C:\\Users\\lenovo\\Desktop\\zabbix_api\\oid.j son"
      auth_token = authenticate()
      data = {
      "jsonrpc": "2.0",
      "method": "item.get",
      "params": {
      "output": ['lastvalue'],
      # "output":'extend',
      "itemids": "67592",
      },
      "auth":auth_token,
      "id": 1
      }
      headers = {
      "Content-Type": "application/json",
      "Authorization": f"Bearer {auth_token}"
      }
      response = requests.post(API_URL, headers=headers, json=data)
      response_data = response.json()
      with open(file, 'w') as output_file:
      json.dump(response_data, output_file, indent=4)
      print("API Response:",response_data)
      if __name__ == "__main__":
      main()

      Comment

      Working...