Centos 6.3: Some quick tips & Init script

Started by javiers, December 12, 2012, 01:19:42 AM

Previous topic - Next topic

javiers

Hi,

Does anybody here have a sysV iniscript for running the agent as a daemon on startup, and allowing interaction with it using chkconfig?.

I managed to install the agent on Linux, juts some easy tips:



  • Install make, gcc and  gcc-c++: #yum update && yum install make gcc gcc-c++

  • Follow the manual for UNIX here: http://goo.gl/9EmNd

  • Add an iptables Exception:
    a) vi /etc/sysconfig/iptables.
    b) Add the following line just after the SNMP exception: -A INPUT --protocol tcp --dport 4700 -j ACCEPT

    This is a dump of my iptables' config file first few lines:

    # Firewall configuration written by system-config-firewall
    # Manual customization of this file is not recommended.
    *filter
    :INPUT ACCEPT [0:0]
    :FORWARD ACCEPT [0:0]
    :OUTPUT ACCEPT [0:0]
    -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
    -A INPUT -p icmp -j ACCEPT
    -A INPUT -i lo -j ACCEPT
    -A INPUT --protocol udp --dport 161 -j ACCEPT
    -A INPUT --protocol tcp --dport 4700 -j ACCEPT


  • Add startup services (courtesy of Victor): http://goo.gl/9LoVq

    here are startup files in source tree under contrib/startup/redhat. Copy netxmsd and nxagentd to /etc/init.d, and run

    chkconfig --add nxagentd
    chkconfig --add netxmsd

  • Run the service:
    #service nxagentd start
Regards.

EDIT: So I found it in the forum...lazy me. Added this and iptables exception.