Ad Widget

Collapse

Monitoring SSH (TCP 22 port) not working

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sajgon107
    Junior Member
    • Mar 2023
    • 9

    #1

    Monitoring SSH (TCP 22 port) not working


    Hello guys, Im having troubles with configuring a item to monitor SSH service on few devices. SSH servis (TCP22) service is running and i can connect from zabbix server over ssh to machine but zabbix still alerts ssh service down. I've used SSH template and as well custom item set as a simple check (net.tcp.service[tcp,,Port_number]) but I still got 0 as a return value. Could you help me out please?
    Thanks
  • Answer selected by Sajgon107 at 04-08-2023, 11:37.
    cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    Security-Enhanced Linux secures the zabbix processes via flexible mandatory access control. The zabbix processes execute with the zabbix_t SELinux type. You can

    If you want to determine whether zabbix can connect to all TCP ports, you must turn on the zabbix_can_network boolean. Disabled by default.

    setsebool -P zabbix_can_network 1

    Comment

    • SanMonitor
      Member
      • Aug 2022
      • 48

      #2
      Hey Sajgon,
      any reason why you're not using net.tcp.service[ssh,,port_number] as your check?

      Comment

      • Sajgon107
        Junior Member
        • Mar 2023
        • 9

        #3
        Originally posted by SanMonitor
        Hey Sajgon,
        any reason why you're not using net.tcp.service[ssh,,port_number] as your check?
        Hello,
        yes I did try that, still zabbix returns 0 value.

        Comment

        • Vermizz
          Member
          • Oct 2022
          • 33

          #4
          Hi,
          can you try using like this: net.tcp.service[ssh] as a simple check
          Does the check work on others​ hosts?
          What system are you using on​ Zabbix Server? Maybe selinux (redhat/centos) or apparmor (ubuntu/debian) block simple check on SSH.

          Comment

          • Sajgon107
            Junior Member
            • Mar 2023
            • 9

            #5
            Originally posted by Vermizz
            Hi,
            can you try using like this: net.tcp.service[ssh] as a simple check
            Does the check work on others​ hosts?
            What system are you using on​ Zabbix Server? Maybe selinux (redhat/centos) or apparmor (ubuntu/debian) block simple check on SSH.
            Hello, I've tried net.tcp.service[ssh] as a simple check but still Im getting 0 in return. Im running zabbix version 6 on centos distribution, when I try to connect from CLI of that linux machine to host over ssh the connection is working, this problem occurs on different hosts as well.

            Comment

            • Vermizz
              Member
              • Oct 2022
              • 33

              #6
              For test only please check selinux is enable "getenforce" if yes disable it for test: "setenforce 0" and execute simple check.

              You can also run test like this: Login to Zabbix server and run command: zabbix_get -s 1.1.1.1 -k net.tcp.service[ssh]
              Where 1.1.1.1 is your destination hosts.​

              Comment

              • Sajgon107
                Junior Member
                • Mar 2023
                • 9

                #7
                Originally posted by Vermizz
                For test only please check selinux is enable "getenforce" if yes disable it for test: "setenforce 0" and execute simple check.

                You can also run test like this: Login to Zabbix server and run command: zabbix_get -s 1.1.1.1 -k net.tcp.service[ssh]
                Where 1.1.1.1 is your destination hosts.​
                Thanks for help, after turning off getenforce it worked. Can you suggest me how to configure it while keeping getenforce on?
                Thanks

                Comment

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

                  #8
                  Security-Enhanced Linux secures the zabbix processes via flexible mandatory access control. The zabbix processes execute with the zabbix_t SELinux type. You can

                  If you want to determine whether zabbix can connect to all TCP ports, you must turn on the zabbix_can_network boolean. Disabled by default.

                  setsebool -P zabbix_can_network 1

                  Comment

                  • Sajgon107
                    Junior Member
                    • Mar 2023
                    • 9

                    #9
                    Thanks a lot, its working now.

                    Comment

                    Working...