Zabbix 3.0.9



  • Hi All,

    Testing Zabbix 3.0.9 , Configured zabbix-server , configured agent in another simple lamp machine.
    Added http , mysql ,sshd and OS Linux template for the host , and server is detecting changes and service restarts ect.

    But when tried to configure configuration > Action getting an error .

    The action tries to execute the remote command and fails with the error "Cannot establish SSH session: Failed getting banner"

    Even tried to create an action in zabbix-server itself(By enabling zabbix-agent in zabbix server and created an action to restart sshd service if went down) . But again the same error reoccurs.

    Any body have faced the same issue ?

    0_1495028575814_zabbix.jpg



  • @Ajin Can you connect directly through ssh?



  • @wirestyle22 : Yes both ssh and telnet gets connected.



  • @Ajin Do you have selinux enabled? If so, disable it temporarily and test.

    If that works you can run this to allow httpd:

    setsebool -P httpd_can_network_connect 1



  • @wirestyle22 : selinux and firewalld both are disabled.



  • @wirestyle22 said in Zabbix 3.0.9:

    setsebool -P httpd_can_network_connect 1

    [[email protected] ssh]# setsebool -P httpd_can_network_connect 1
    setsebool: SELinux is disabled.



  • @Ajin said in Zabbix 3.0.9:

    @wirestyle22 said in Zabbix 3.0.9:

    setsebool -P httpd_can_network_connect 1

    [[email protected] ssh]# setsebool -P httpd_can_network_connect 1
    setsebool: SELinux is disabled.

    Right, that was if selinux was enabled and disabling it fixed the problem--which it didn't.



  • paging @dafyre as our resident Zabbix guy



  • @wirestyle22 : Hey thanks for that.


  • Service Provider

    @wirestyle22 said in Zabbix 3.0.9:

    paging @dafyre and our resident Zabbix guy

    And @Mike-Davis



  • Can you post a screenshots of how you have your action configured?

    Also, in the Zabbix Agent, you'll need to make sure that both the Server and ServerActive items are set to be the IP address of your zabbix server... and that Remote Commands are enabled.

    /etc/zabbix/zabbix_agentd.conf

    #IP Of Zabbix Server
    Server = 192.168.200.10
    ServerActive = 192.168.200.10
    
    #Enable Remote Commands for restarting services
    EnableRemoteCommands = 1


  • @dafyre : both the Server and ServerActive items are set to the IP address of zabbix server.
    Remote Commands are also enabled.

    Attaching screenshot for action conditions & operations.
    0_1495113066051_3.JPG


  • Service Provider

    @scottalanmiller said in Zabbix 3.0.9:

    @wirestyle22 said in Zabbix 3.0.9:

    paging @dafyre and our resident Zabbix guy

    And @Mike-Davis

    I've only set up the action to email. Never tried remote commands, but it gives me some ideas.



  • @Mike-Davis : My Idea was to create a monitoring / alerting system and also minimize downtime for critical issue like Apache , Mysql and other critical server services which affects server perfomance, This action section actuality does it all since it can both send alerts via email and sms and also execute remote commands.

    But of-course, only if it is configured correctly and works well :)



  • I'm going to be looking more at Zabbix over the next few months and exploring it's power and potential


  • Service Provider

    @Ajin said in Zabbix 3.0.9:

    @Mike-Davis : My Idea was to create a monitoring / alerting system and also minimize downtime for critical issue like Apache , Mysql and other critical server services which affects server perfomance, This action section actuality does it all since it can both send alerts via email and sms and also execute remote commands.

    But outsource, only if it is configured correctly and works well :)

    It's a good idea. I haven't had a need yet, but I'm sure that day will come.



  • @Ajin said in Zabbix 3.0.9:

    @dafyre : both the Server and ServerActive items are set to the IP address of zabbix server.
    Remote Commands are also enabled.

    Attaching screenshot for action conditions & operations.
    0_1495113066051_3.JPG

    What if you set the Remote Command type to "Custom Script" and had it execute something like systemctl restart apache2 or httpd, whatever your distro uses...

    0_1495114640947_upload-6dc12176-0deb-482e-b0a2-955dae73f93e



  • @dafyre : Thankyou so Much because ..Yesssss :) That did the job ...Remote command got executed in the host when selected the TYPE as custom script and services which went down is restarting in 60 seconds as configured.

    Another thing i am testing now is , Since the Action Section uses zabbix-agent to run the custom script type to execute remote command ; what if the zabbix-agent itself went down or had some issue and it coudnt respond to server checks ? . Here this scenario (Choosing the TYPE as custom script)will fail for all other Actions . IN that case i need to fix the Remote command execution via SSH and also Test the GLOBAL SCRIPT Type to check zabbix-agent service.

    Since i am planning to Implement this Tool in my Production Environment , need to think and test every possible scenarios where server or its critical services can get screwed up !!! And now next global script and again ssh ..
    0_1495123267990_12.jpg



  • @Ajin Glad you got that working



  • @dafyre said in Zabbix 3.0.9:

    @Ajin said in Zabbix 3.0.9:

    @dafyre : both the Server and ServerActive items are set to the IP address of zabbix server.
    Remote Commands are also enabled.

    Attaching screenshot for action conditions & operations.
    0_1495113066051_3.JPG

    What if you set the Remote Command type to "Custom Script" and had it execute something like systemctl restart apache2 or httpd, whatever your distro uses...

    0_1495114640947_upload-6dc12176-0deb-482e-b0a2-955dae73f93e

    Glad that it worked for you!



  • @Ajin said in Zabbix 3.0.9:

    Another thing i am testing now is , Since the Action Section uses zabbix-agent to run the custom script type to execute remote command ; what if the zabbix-agent itself went down or had some issue and it coudnt respond to server checks ? . Here this scenario (Choosing the TYPE as custom script)will fail for all other Actions . IN that case i need to fix the Remote command execution via SSH and also Test the GLOBAL SCRIPT Type to check zabbix-agent service.
    Since i am planning to Implement this Tool in my Production Environment , need to think and test every possible scenarios where server or its critical services can get screwed up And now next global script and again ssh ..

    In this scenario, if the Zabbix agent goes down, the custom scripts won't run, I'd imagine.

    I've never gone down the rabbit hole quite that far. I would assume if the Zabbix agent is not responding that you would have other issues (or set the Zabbix server to alert you that the Zabbix agent wasn't responding).



  • @dafyre :Ran Into another problem Now.
    Mysql service up/down status is not displayed in host status Tab. But in the graph part all mysql data is fetched from client machine and displayed in Zabbix server .like Mysql Bandwidth ,Mysql Uptime , Mysql operations ect .

    Since the service up/down is not being displayed in host status , Cannot execute Actions (remote command & notifications)

    All other services like Apache , ssh , telnet , cpu hike , Disk usage , Network usage .. every actions to the above said services are being fetched by zabbix-agent and displayed in zabbix-server GUI.

    Checked the Zabbix-server log ,

    Data for mysql services are being logged , But not displaying the service UP or down in server GUI.

    LOG:
    [[email protected] ~]# tail -f /var/log/zabbix/zabbix_server.log | grep mysql
    2259:20170521:151451.735 Sending [mysql.status[Questions]
    2261:20170521:151452.738 In substitute_key_macros() data:'mysql.status[Slow_queries]'
    2261:20170521:151452.738 End of substitute_key_macros():SUCCEED data:'mysql.status[Slow_queries]'
    2261:20170521:151452.738 In get_value() key:'mysql.status[Slow_queries]'
    2261:20170521:151452.738 In get_value_agent() host:'2.test.com' addr:'10.132.166.113' key:'mysql.status[Slow_queries]' conn:'unencrypted'
    2261:20170521:151452.739 Sending [mysql.status[Slow_queries]
    2262:20170521:151453.743 In substitute_key_macros() data:'mysql.status[Uptime]'
    2262:20170521:151453.743 End of substitute_key_macros():SUCCEED data:'mysql.status[Uptime]'
    2262:20170521:151453.744 In get_value() key:'mysql.status[Uptime]'
    2262:20170521:151453.744 In get_value_agent() host:'2.test.com' addr:'10.132.166.113' key:'mysql.status[Uptime]' conn:'unencrypted'
    2262:20170521:151453.744 Sending [mysql.status[Uptime]



  • @Ajin said in Zabbix 3.0.9:

    @dafyre :Ran Into another problem Now.
    Mysql service up/down status is not displayed in host status Tab. But in the graph part all mysql data is fetched from client machine and displayed in Zabbix server .like Mysql Bandwidth ,Mysql Uptime , Mysql operations ect .

    Since the service up/down is not being displayed in host status , Cannot execute Actions (remote command & notifications)

    All other services like Apache , ssh , telnet , cpu hike , Disk usage , Network usage .. every actions to the above said services are being fetched by zabbix-agent and displayed in zabbix-server GUI.

    Checked the Zabbix-server log ,

    Data for mysql services are being logged , But not displaying the service UP or down in server GUI.

    LOG:
    [[email protected] ~]# tail -f /var/log/zabbix/zabbix_server.log | grep mysql
    2259:20170521:151451.735 Sending [mysql.status[Questions]
    2261:20170521:151452.738 In substitute_key_macros() data:'mysql.status[Slow_queries]'
    2261:20170521:151452.738 End of substitute_key_macros():SUCCEED data:'mysql.status[Slow_queries]'
    2261:20170521:151452.738 In get_value() key:'mysql.status[Slow_queries]'
    2261:20170521:151452.738 In get_value_agent() host:'2.test.com' addr:'10.132.166.113' key:'mysql.status[Slow_queries]' conn:'unencrypted'
    2261:20170521:151452.739 Sending [mysql.status[Slow_queries]
    2262:20170521:151453.743 In substitute_key_macros() data:'mysql.status[Uptime]'
    2262:20170521:151453.743 End of substitute_key_macros():SUCCEED data:'mysql.status[Uptime]'
    2262:20170521:151453.744 In get_value() key:'mysql.status[Uptime]'
    2262:20170521:151453.744 In get_value_agent() host:'2.test.com' addr:'10.132.166.113' key:'mysql.status[Uptime]' conn:'unencrypted'
    2262:20170521:151453.744 Sending [mysql.status[Uptime]

    Do you mean that you cannot tell whether or not the MySQL Service is running?


  • Service Provider

    Do you even have MySQL? You might have MariaDB.



  • @JaredBusch : yes , I have mariadb. (Server version: 5.5.52-MariaDB MariaDB Server)
    Is there any compatibility issue with zabbbix-server and mariadb ?


  • Service Provider

    @Ajin said in Zabbix 3.0.9:

    @JaredBusch : yes , I have mariadb. (Server version: 5.5.52-MariaDB MariaDB Server)
    Is there any compatibility issue with zabbbix-server and mariadb ?

    I mean on the box you are trying to get an alert from.

    You are looking for the MySQL service, it does not exist if you are using MariaDB.



  • @JaredBusch : Yea i agree but the only template present in Zabbix-server to monitor DB servers for Linux is "Template App MySQL".
    Zabbix forums also says that "Template App MySQL". is used to monitor MariaDB databases.



  • If you want to see it on a graph, you could Add a graph to the Template App MySQL... and then add the Template app MySQL to the MariaDB servers you have...

    Your Graph would look something like:
    0_1495518300608_upload-e3f0ab7a-817a-443d-8aa9-21fb920cb5c1



  • @dafyre :Thanks a lot , Will test it out and post back


Log in to reply
 

Looks like your connection to MangoLassi was lost, please wait while we try to reconnect.