Ad Widget

Collapse

Script Item not compiling

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AKC99
    Junior Member
    • Feb 2024
    • 7

    #1

    Script Item not compiling

    I'm very new to Zabbix and trying to make a script item so I can write to a coil on my device with SNMP. So, I need to use snmpset to write 1 to the coil's OID to do the action detailed in the coil. When I test my item, I get and error saying: "Cannot compile script: SyntaxError: unterminated statement (line 1)". This is my first time trying to make a script item and I can't find anything about this error message in the forums. Here is my script setup and test:
    Click image for larger version  Name:	image.png Views:	0 Size:	144.1 KB ID:	482186


    Click image for larger version  Name:	image.png Views:	0 Size:	77.5 KB ID:	482185
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #2
    Script type means JavaScript, not bash or something else... https://www.zabbix.com/documentation...emtypes/script

    Comment

    • AKC99
      Junior Member
      • Feb 2024
      • 7

      #3
      I was following the examples in that manual which is how I got this far. I guess because I don't know JavaScript, I'm don't understand why my script does not compile.

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4806

        #4
        You did not write any JS.... As long as I can see, you entered snmpset .... there which is a command line tool and has nothing to do with JS...

        Comment

        • AKC99
          Junior Member
          • Feb 2024
          • 7

          #5
          I see what you mean now. Again I'm really new to Zabbix so when I saw this forum: https://www.zabbix.com/forum/zabbix-...et-with-zabbix talking about using snmpset in scripts in Zabbix, I thought it was talking about item scripts as that was the only type of scripts I found in the appliance. Looking more at JavaScript I don't know if it's feasible to write to my SNMP items in JSON. Is there any other way to write to my SNMP items in the appliance?
          Last edited by AKC99; 10-04-2024, 17:13.

          Comment

          • Weni
            Junior Member
            • Sep 2022
            • 1

            #6
            Hi
            Have you solvd the Problem with SNMPSET.
            I want also set a Automatique to Restart my AP's.

            Comment

            Working...