Ad Widget

Collapse

A net.tcp.service returns 1 when run manually, but Zabbix reports 0

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brain2000
    Junior Member
    • Aug 2024
    • 16

    #1

    A net.tcp.service returns 1 when run manually, but Zabbix reports 0

    I'm having an issue where net.tcp.service(tcp,localhost,1433) returns 1 when run manually, but Zabbix reports 0.

    This is the manual run:

    root@operations:/# zabbix_get -s LUCYTEST.mst.com -p 10050 -k net.tcp.service[tcp,localhost,1433]
    1​


    As you can see, a 1 is returned.
    This is what Zabbix is reporting:
    Click image for larger version

Name:	image.png
Views:	377
Size:	16.1 KB
ID:	489244


    Here is the configuration for the trigger, in case it holds any clues.​
    I double checked the macros on the host
    {$MSSQL.HOST} == localhost
    {$MSSQL.PORT} == 1433
    Click image for larger version

Name:	image.png
Views:	287
Size:	42.6 KB
ID:	489245

    Perhaps it is the value mapping which turns 0 and 1 into Down and Up?
    Click image for larger version

Name:	image.png
Views:	285
Size:	42.8 KB
ID:	489246

    But I'm thinking if that were the case, last(/LUCYTEST.mst.com/net.tcp.service[tcp,localhost,1433])=0 would not evaluate to true, as it would be "Down" instead of "0".
    I am a bit new to Zabbix, so I am probably just overlooking something simple.
    I would appreciate any pointers in the right direction.
  • Answer selected by Brain2000 at 09-08-2024, 18:56.
    cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    Value mapping is for visual aid, calculations are still done on original value.

    ANd please change yout item type from simple check to "zabbix agent" or "zabbix agent (active)" and it should start working. "simple check" will be executed on server/proxy and most probably runs into wall and you get "no connection".
    you test with zabbix_get, which means it will be run through that particular agent of LUCYTEST.mst.com locally. Or you can also open FW hole from server to that host/port and it will work also as simple check...

    Comment


    • Brain2000
      Brain2000 commented
      Editing a comment
      Thank you! I found another post about "Simple Check" elsewhere, and I didn't realize that it actually means "Local Check".
      The default in the MSSQL for Zabbix Agent yaml defaults the value in the Simple Check to "localhost".
      I've redone the yaml template so it doesn't repeat the host in multiple places, and it is all working now without any extra configuration after adding new hosts. Very handy when there are many SQL hosts being added.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Value mapping is for visual aid, calculations are still done on original value.

    ANd please change yout item type from simple check to "zabbix agent" or "zabbix agent (active)" and it should start working. "simple check" will be executed on server/proxy and most probably runs into wall and you get "no connection".
    you test with zabbix_get, which means it will be run through that particular agent of LUCYTEST.mst.com locally. Or you can also open FW hole from server to that host/port and it will work also as simple check...

    Comment


    • Brain2000
      Brain2000 commented
      Editing a comment
      Thank you! I found another post about "Simple Check" elsewhere, and I didn't realize that it actually means "Local Check".
      The default in the MSSQL for Zabbix Agent yaml defaults the value in the Simple Check to "localhost".
      I've redone the yaml template so it doesn't repeat the host in multiple places, and it is all working now without any extra configuration after adding new hosts. Very handy when there are many SQL hosts being added.
Working...