Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Monitoring tool for server? - Page 2
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Monitoring tool for server?

2»

Comments

  • +1 for NIXStats. :)

    Thanked by 1vfuse
  • The fact that you need to allow this product exec(), well... I don't know. I wouldn't trust this product with root privileges (required by socket_create() for ICMP), so I guess it's the lesser of the two evils. Still, ugh.

  • WSSWSS Member
    edited September 2017

    @Zerpy said:
    I believe every major OS today actually runs SQL on a socket for localhost these days, all system versions and/or upstream mysql/percona/mariadb packages I've downloaded all connects directly using sockets, so you won't see the traffic anymore on your loopback :-D

    If you're running the code on the same system as your SQL service. How many memcache/redis products do you know that use local domain sockets? Not all that many, since, uh, they're not generally also local? ;)


    Shit, thought I pasted this as an edit into the last post rather than making two. Bedtime for Bonzo!

  • mailcheapmailcheap Member, Host Rep

    Zabbix. Very good documentation & features; easy to setup. $0.

    Pavin.

  • Collectd on nodes posting metrics to central InfluxDB rendered through Grafana. Both have hosted versions for free if you're too lazy to setup them on your side.
    Nginx Amplify agent has some nice features for nginx though suitable for general monitoring as well.

  • @WSS said:
    If you're running the code on the same system as your SQL service. How many memcache/redis products do you know that use local domain sockets? Not all that many, since, uh, they're not generally also local? ;)

    Binding to an IP doesn't change the fact that if you're communicating with MySQL locally it won't go over your loopback device.

    e.g. if you set PHP or Python to connect to mysql on localhost, it will connect using a socket and not something that goes over your loopback.

    Not all that many, since, uh, they're not generally also local? ;)

    It really depends on the application, there's so many good examples where a local Memcache or redis instance can make sense, even in large scale setups ;)

  • @Zerpy said:

    e.g. if you set PHP or Python to connect to mysql on localhost, it will connect using a socket and not something that goes over your loopback.

    This is simply not true. Many poor admins (WordPress people) still use 127.0.0.1 rather than the domain socket://var/tmp/mysql_sock - or wherever it is. If you are doing a UNIX socket, it's not the same as a domain socket.

    Not all that many, since, uh, they're not generally also local? ;)

    It really depends on the application, there's so many good examples where a local Memcache or redis instance can make sense, even in large scale setups ;)

    Depends on your design, but this has gone far off from monitoring tools. I generally just use monit and munin- it suits my needs.

  • @WSS said:

    @Zerpy said:

    e.g. if you set PHP or Python to connect to mysql on localhost, it will connect using a socket and not something that goes over your loopback.

    This is simply not true. Many poor admins (WordPress people) still use 127.0.0.1 rather than the domain socket://var/tmp/mysql_sock - or wherever it is. If you are doing a UNIX socket, it's not the same as a domain socket.

    If you put "localhost", PHP for example will try to connect to a local socket, and not over TCP/IP - same goes for Python I believe.

    Also majority of 1-click installers and scripts for installing software puts localhost instead of 127.0.0.1, thus connecting via local socket instead of TCP.

    So it's simply not true that they use 127.0.0.1 - because people (and hosts) usually tell customers to put "localhost".

    cPanel by default doesn't even allow "127.0.0.1" since it's not in the user.Host column in MySQL :-D

    Oh well, agree to disagree

  • WSSWSS Member
    edited September 2017

    @Zerpy said:
    Oh well, agree to disagree

    We could, but you'd still be wrong. Read the differences in a UNIX socket and an INET socket. I'll even link an example in the PHP manual for you.

    localhost is in every hosts file on every computer pointing to that IP. Feel free to look for yourself.

    E: Fucking ClodFart.

  • @WSS said:

    @Zerpy said:
    Oh well, agree to disagree

    We could, but you'd still be wrong. Read the differences in a UNIX socket and an INET socket. I'll even link an example in the PHP manual for you.

    localhost is in every hosts file on every computer pointing to that IP. Feel free to look for yourself.

    Just because you link to PHP Manual, then also note the PHP manual says the following:

    Note:
    Whenever you specify "localhost" or "localhost:port" as server, the MySQL client library will override this and try to connect to a local socket (named pipe on Windows). If you want to use TCP/IP, use "127.0.0.1" instead of "localhost". If the MySQL client library tries to connect to the wrong local socket, you should set the correct path as in your PHP configuration and leave the server field blank.
    

    aka, even if your /etc/hosts say localhost 8.8.8.8, PHP will translate localhost into a local socket.

    Feel free to try for yourself.

    Connect to mysql via localhost in PHP, lsof the PID of the PHP process, e.g.:

    # lsof -p 6049 | grep socket
    php     6049 root  mem    REG              253,1     87360   136904 /usr/lib64/php/modules/sockets.so
    php     6049 root    3u  unix 0xffff8800371da000       0t0 21473695 socket
    

    Socket 21473695 == mysql:

    [root@gra1-001 fd]# ss -p | grep 21473695
    u_str  ESTAB      0      0       * 21473695              * 21473696              users:(("php",pid=6049,fd=3))
    u_str  ESTAB      0      0      /var/lib/mysql/mysql.sock 21473696              * 21473695              users:(("mysqld",pid=719,fd=48))
    

    This is when localhost points to 127.0.0.1 in /etc/hosts.

    Doing the same when it points to 8.8.8.8:

    [root@gra1-001 ~]# ping -c 1 localhost | grep "icmp_seq"; php -f dbtest.php
    64 bytes from localhost (8.8.8.8): icmp_seq=1 ttl=56 time=4.58 ms
    Connecting to localhostThere are 78 tables

    As you can see, localhost points to 8.8.8.8, we now do the same:

    [root@gra1-001 fd]# lsof -p 6585| grep socket
    php     6585 root  mem    REG              253,1     87360   136904 /usr/lib64/php/modules/sockets.so
    php     6585 root    3u  unix 0xffff88008bcac000       0t0 21476178 socket
    

    Socket 21476178 == mysql:

    [root@gra1-001 fd]# ss -p | grep 21476178
    u_str  ESTAB      0      0       * 21476178              * 21476179              users:(("php",pid=6585,fd=3))
    u_str  ESTAB      0      0      /var/lib/mysql/mysql.sock 21476179              * 21476178              users:(("mysqld",pid=719,fd=48))
    

    So I guess you're wrong :-)

    Thanked by 1ferri
  • WSSWSS Member
    edited September 2017

    @Zerpy said:
    Note:
    Whenever you specify "localhost" or "localhost:port" as server, the MySQL client library will override this and try to connect to a local socket (named pipe on Windows). If you want to use TCP/IP, use "127.0.0.1" instead of "localhost". If the MySQL client library tries to connect to the wrong local socket, you should set the correct path as in your PHP configuration and leave the server field blank.

    Well that's fucking retarded.

    So I guess you're wrong :-)

    Depends on when they implemented this. So glad I don't admin this shit! Thanks for the clarification.

  • @WSS said:

    @Zerpy said:
    Note:
    Whenever you specify "localhost" or "localhost:port" as server, the MySQL client library will override this and try to connect to a local socket (named pipe on Windows). If you want to use TCP/IP, use "127.0.0.1" instead of "localhost". If the MySQL client library tries to connect to the wrong local socket, you should set the correct path as in your PHP configuration and leave the server field blank.

    Well that's fucking retarded.

    So I guess you're wrong :-)

    Depends on when they implemented this. So glad I don't admin this shit! Thanks for the clarification.

    Since mysql_* days which is long gone :(

  • Hello everyone,

    I am the creator of nMon and wanted to add some more info about WSS' statement.

    WSS is correct, exec() is a nasty thing but as this software is written only in PHP this was the only way I can execute PING checks reliably. I have tried a lot of methods but none of them worked properly and decided eventually to use exec.

    This is only needed if you want to use PING, all other checks like TCP port check, blacklist check, website server does not require exec to be available.

    Servers are monitored with an agent (simple bash script that runs every minute and posts data back to nMon), nMon does not need, require or retains access to your server.
    nMon is fully open source and the agent is available on github (link below) if anyone has any doubts.

    https://github.com/codeniner/nmonagent

    I do not know if this counts as advertising or not, if so I apologies.

    @WSS said:

    The fact that you need to allow this product exec(), well... I don't know. I wouldn't trust this product with root privileges (required by socket_create() for ICMP), so I guess it's the lesser of the two evils. Still, ugh.

Sign In or Register to comment.