Ad Widget

Collapse

Unable to Complete Email Media Test

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kirkofthefleet
    Junior Member
    • Dec 2021
    • 3

    #1

    Unable to Complete Email Media Test

    I am having issue setting up the email media type in zabbix. I've been chasing this ghost for a while and think I may have found the issue, but I'm unsure how to fix it. In my zabbix_server.log file I found two lines that seem to enumerate the issue. The below implies (to me at least) that zabbix is attempting to log in (guessing here) and use bash or something to send the email. My server does have a zabbix user configured with /sbin/nologin to prevent it from being able to log in to CLI. I am willing to change that, but I cannot see how as from what I can tell, the server isn't even configured properly to run as zabbix, but it is as shown in the output of top below.

    Here is the error from the Zabbix Log

    Code:
    638:20211214:150715.203 worker_preprocess_value(): ERROR 1045 (28000): Access denied for user 'zabbix'@'localhost' (using password: NO)
    638:20211214:150715.204 worker_preprocess_value: FAIL Preprocessing failed for: ERROR 1045 (28000): Access denied for user 'zabbix'@'localhost' (using password: NO)
    From what I can tell, my zabbix configuration does not specify which user to run at. I expected it to be set to run as Zabbix, but that line is commented out in my configuration.

    Code:
    ### Option: AllowRoot
    # Allow the server to run as 'root'. If disabled and the server is started by 'root', the server
    # will try to switch to the user specified by the User configuration option instead.
    # Has no effect if started under a regular user.
    # 0 - do not allow
    # 1 - allow
    #
    # Mandatory: no
    # Default:
    # AllowRoot=0
    
    ### Option: User
    # Drop privileges to a specific, existing user on the system.
    # Only has effect if run as 'root' and AllowRoot is disabled.
    #
    # Mandatory: no
    # Default:
    # User=zabbix
    The only reference to User=Zabbix found in the entire config file is for the mariadb user.

    Code:
    ### Option: DBUser
    # Database user.
    #
    # Mandatory: no
    # Default:
    # DBUser=
    
    DBUser=zabbix
    Here is the output from top showing the zabbix user running all services. How is this working if the corresponding lines in the config are commented out?

    Code:
    top - 15:19:51 up 2:36, 1 user, load average: 0.47, 0.47, 0.37
    619 zabbix 20 0 251632 20296 12828 S 0.7 0.5 0:13.68 zabbix_server
    606 zabbix 20 0 240588 12340 3916 S 0.3 0.3 0:11.87 zabbix_server
    607 zabbix 20 0 240932 12676 3932 S 0.3 0.3 0:12.15 zabbix_server
    634 zabbix 20 0 234112 6624 4600 S 0.3 0.2 0:30.65 zabbix_server
    345 zabbix 20 0 81236 2468 1652 S 0.0 0.1 0:00.00 zabbix_agentd
    346 zabbix 20 0 81236 2828 2012 S 0.0 0.1 0:01.89 zabbix_agentd
    347 zabbix 20 0 81364 5632 4624 S 0.0 0.1 0:01.32 zabbix_agentd
    348 zabbix 20 0 81364 5628 4624 S 0.0 0.1 0:01.36 zabbix_agentd
    350 zabbix 20 0 81364 5632 4624 S 0.0 0.1 0:01.31 zabbix_agentd
    351 zabbix 20 0 81364 5360 4356 S 0.0 0.1 0:00.48 zabbix_agentd
    352 zabbix 20 0 233988 8484 6552 S 0.0 0.2 0:00.05 zabbix_server
    592 zabbix 20 0 234000 5708 3740 S 0.0 0.1 0:02.80 zabbix_server
    593 zabbix 20 0 234388 4976 2820 S 0.0 0.1 0:00.41 zabbix_server
    594 zabbix 20 0 233988 4576 2644 S 0.0 0.1 0:00.49 zabbix_server
    595 zabbix 20 0 233988 4620 2676 S 0.0 0.1 0:01.05 zabbix_server
    598 zabbix 20 0 234880 8736 5784 S 0.0 0.2 0:00.23 zabbix_server
    599 zabbix 20 0 234880 8880 5928 S 0.0 0.2 0:00.23 zabbix_server
    600 zabbix 20 0 249868 11532 8444 S 0.0 0.3 0:01.22 zabbix_server
    601 zabbix 20 0 249868 11728 8624 S 0.0 0.3 0:01.66 zabbix_server
    602 zabbix 20 0 249868 11800 8700 S 0.0 0.3 0:01.63 zabbix_server
    603 zabbix 20 0 240452 12316 4056 S 0.0 0.3 0:14.11 zabbix_server
    609 zabbix 20 0 234104 7636 5668 S 0.0 0.2 0:02.19 zabbix_server
    611 zabbix 20 0 233988 7712 5736 S 0.0 0.2 0:00.91 zabbix_server
    613 zabbix 20 0 233988 3804 1872 S 0.0 0.1 0:02.60 zabbix_server
    614 zabbix 20 0 233988 4600 2668 S 0.0 0.1 0:00.68 zabbix_server
    615 zabbix 20 0 251628 20264 12820 S 0.0 0.5 0:12.72 zabbix_server
    616 zabbix 20 0 251632 20352 12860 S 0.0 0.5 0:14.67 zabbix_server
    617 zabbix 20 0 251632 19804 12856 S 0.0 0.5 0:11.74 zabbix_server
    618 zabbix 20 0 251632 20300 12832 S 0.0 0.5 0:13.47 zabbix_server
    620 zabbix 20 0 238288 10496 7444 S 0.0 0.3 0:01.07 zabbix_server
    621 zabbix 20 0 236260 10136 8052 S 0.0 0.2 0:00.19 zabbix_server
    622 zabbix 20 0 236260 9736 7652 S 0.0 0.2 0:00.18 zabbix_server
    623 zabbix 20 0 236260 10320 8236 S 0.0 0.2 0:00.18 zabbix_server
    624 zabbix 20 0 236260 9736 7652 S 0.0 0.2 0:00.19 zabbix_server
    625 zabbix 20 0 236236 10324 8240 S 0.0 0.2 0:00.18 zabbix_server
    627 zabbix 20 0 237360 4624 2576 S 0.0 0.1 0:01.51 zabbix_server
    625 zabbix 20 0 236236 10324 8240 S 0.0 0.2 0:00.18 zabbix_server

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

    #2
    Those "access denied" lines look more like DB errors ... But don't take it for granted...
    And to execute a script, it does not need to "log in", it is already "in"..

    Comment

    • kirkofthefleet
      Junior Member
      • Dec 2021
      • 3

      #3
      cyber

      I 100% agree about the login thing, but nothing is making sense so I'm grasping at straws. But I did test your theory and It looks like you arecorrect. I didn't have mariadb set up to show me login errors so that's why I didn't see any when I looked. I turned on the error logging and set it to its own file and found this from my most recent email testing attempt:

      Code:
      211215 8:01:46 [Warning] Access denied for user 'UNKNOWN_MYSQL_US'@'localhost' (using password: NO)
      So where in the world is it getting this "UNKNOWN_MYSQL_US user from?

      Comment

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

        #4
        It looks like you have some issues with DB setup. Either no user is created or no permissions granted. Is everything else working fine?

        Comment

        • kirkofthefleet
          Junior Member
          • Dec 2021
          • 3

          #5
          Everything else is working perfectly. This is literally the only thing I haven't been able to get going. The server has been up and monitoring away, I just need to get notifications going.

          Would it be easier to just create a script and maybe use sendmail or mailx?

          I agree there is an issue with my configuration but I cannot find it. I even went as far as searching the entire server for any files containing that string in case its hard coded in somewhere it should not be.

          Forgive my ignorance in this, I'm a network guy trying to learn some new tricks. I'm pretty good with Linux but a lot of this is a brand new world for me.

          Comment

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

            #6
            I am not good on remote troubleshooting.. Just throwing random things in the air here... I have a feeling, that this db error and email media are not connected...
            Maybe take a look on your selinux setup and errors (if you have it enabled and enforced...) I recently had to install proxies, where selinux was enforced and we discovered multiple things that needed enabling... even fping did not work without selinux mods...

            Comment

            Working...