Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

M

MHammett

@MHammett
Unfollow Follow
About
Posts
8
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • 95 percentile
    M MHammett
    Support

    Did you figure this out?


  • NetXMS and Fail2Ban
    M MHammett
    Support

    Currently everything points at my NetXMS server. I could, I suppose, put in a dst-nat rule above the NetXMS server that redirects all port 514 to a different box that processes it. it's probably something I'd forget while troubleshooting a broken syslog system in the future.  😛


  • Startup Script
    M MHammett
    Support

    Looks like I use this one:

    #!/bin/sh
    # vim: syntax=sh
    ### BEGIN INIT INFO
    # Provides:          netxms-server
    # Required-Start:    $network $local_fs nxagentd
    # Required-Stop:
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: NetXMS server
    # Description:       Network monitoring daemon, which collect and process metrics
    #                    from native and SNMP agents.
    ### END INIT INFO
    
    # Author: Alex Kirhenshtein <[email protected]>
    
    PATH=/sbin:/usr/sbin:/bin:/usr/bin
    DESC="NetXMS server"
    NAME=netxmsd
    DAEMON=/usr/bin/netxmsd
    DAEMON_ARGS="-d"
    PIDFILE=/var/run/$NAME.pid
    SCRIPTNAME=/etc/init.d/$NAME
    
    # Exit if the package is not installed
    [ -x $DAEMON ] || exit 0
    
    # Read configuration variable file if it is present
    [ -r /etc/default/$NAME ] && . /etc/default/$NAME
    
    # Load the VERBOSE setting and other rcS variables
    . /lib/init/vars.sh
    
    # Define LSB log_* functions.
    # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
    . /lib/lsb/init-functions
    
    #
    # Function that starts the daemon/service
    #
    do_start()
    {
            # Return
            #   0 if daemon has been started
            #   1 if daemon was already running
            #   2 if daemon could not be started
            start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
                    || return 1
            start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
                    $DAEMON_ARGS \
                    || return 2
            # Add code here, if necessary, that waits for the process to be ready
            # to handle requests from services started subsequently which depend
            # on this one.  As a last resort, sleep for some time.
    }
    
    #
    # Function that stops the daemon/service
    #
    do_stop()
    {
            # Return
            #   0 if daemon has been stopped
            #   1 if daemon was already stopped
            #   2 if daemon could not be stopped
            #   other if a failure occurred
            start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
            RETVAL="$?"
            [ "$RETVAL" = 2 ] && return 2
            # Wait for children to finish too if this is a daemon that forks
            # and if the daemon is only ever run from this initscript.
            # If the above conditions are not satisfied then add some other code
            # that waits for the process to drop all resources that could be
            # needed by services started subsequently.  A last resort is to
            # sleep for some time.
            start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
            [ "$?" = 2 ] && return 2
            # Many daemons don't delete their pidfiles when they exit.
            rm -f $PIDFILE
            return "$RETVAL"
    }
    
    #
    # Function that sends a SIGHUP to the daemon/service
    #
    do_reload() {
            #
            # If the daemon can reload its configuration without
            # restarting (for example, when it is sent a SIGHUP),
            # then implement that here.
            #
            start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
            return 0
    }
    
    case "$1" in
      start)
        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
        do_start
        case "$?" in
                    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
            esac
      ;;
      stop)
            [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
            do_stop
            case "$?" in
                    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
            esac
            ;;
      status)
           status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
           ;;
      #reload|force-reload)
            #
            # If do_reload() is not implemented then leave this commented out
            # and leave 'force-reload' as an alias for 'restart'.
            #
            #log_daemon_msg "Reloading $DESC" "$NAME"
            #do_reload
            #log_end_msg $?
            #;;
      restart|force-reload)
            #
            # If the "reload" option is implemented then remove the
            # 'force-reload' alias
            #
            log_daemon_msg "Restarting $DESC" "$NAME"
            do_stop
            case "$?" in
              0|1)
                    do_start
                    case "$?" in
                            0) log_end_msg 0 ;;
                            1) log_end_msg 1 ;; # Old process is still running
                            *) log_end_msg 1 ;; # Failed to start
                    esac
                    ;;
              *)
                    # Failed to stop
                    log_end_msg 1
                    ;;
            esac
            ;;
      *)
            echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
            exit 3
            ;;
    esac
    
    :
    

    There was also this one:

    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides:          netxmsd
    # Required-Start:    $remote_fs nxagentd
    # Required-Stop:     $remote_fs
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: NetXMS server initscript
    # Description:       NetXMS server startup script
    ### END INIT INFO
    
    # Author: Raden Solutions <[email protected]>
    
    # Do NOT "set -e"
    
    # PATH should only include /usr/* if it runs after the mountnfs.sh script
    PATH=/sbin:/usr/sbin:/bin:/usr/bin
    DESC="NetXMS Server"
    NAME=netxmsd
    DAEMON=~BINDIR~/$NAME
    DAEMON_ARGS="-d"
    PIDFILE=/var/run/$NAME.pid
    SCRIPTNAME=/etc/init.d/$NAME
    
    # Exit if the package is not installed
    [ -x "$DAEMON" ] || exit 0
    
    # Read configuration variable file if it is present
    [ -r /etc/default/$NAME ] && . /etc/default/$NAME
    
    # Load the VERBOSE setting and other rcS variables
    . /lib/init/vars.sh
    
    # Define LSB log_* functions.
    # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
    . /lib/lsb/init-functions
    
    #
    # Function that starts the daemon/service
    #
    do_start()
    {
            # Return
            #   0 if daemon has been started
            #   1 if daemon was already running
            #   2 if daemon could not be started
            start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
                    || return 1
            start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
                    $DAEMON_ARGS \
                    || return 2
            # Add code here, if necessary, that waits for the process to be ready
            # to handle requests from services started subsequently which depend
            # on this one.  As a last resort, sleep for some time.
    }
    
    #
    # Function that stops the daemon/service
    #
    do_stop()
    {
            # Return
            #   0 if daemon has been stopped
            #   1 if daemon was already stopped
            #   2 if daemon could not be stopped
            #   other if a failure occurred
            start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
            RETVAL="$?"
            [ "$RETVAL" = 2 ] && return 2
            # Wait for children to finish too if this is a daemon that forks
            # and if the daemon is only ever run from this initscript.
            # If the above conditions are not satisfied then add some other code
            # that waits for the process to drop all resources that could be
            # needed by services started subsequently.  A last resort is to
            # sleep for some time.
            start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
            [ "$?" = 2 ] && return 2
            # Many daemons don't delete their pidfiles when they exit.
            rm -f $PIDFILE
            return "$RETVAL"
    }
    
    #
    # Function that sends a SIGHUP to the daemon/service
    #
    do_reload() {
            #
            # If the daemon can reload its configuration without
            # restarting (for example, when it is sent a SIGHUP),
            # then implement that here.
            #
            start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
            return 0
    }
    
    case "$1" in
      start)
            [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
            do_start
            case "$?" in
                    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
            esac
            ;;
      stop)
            [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
            do_stop
            case "$?" in
                    0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                    2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
            esac
            ;;
      #reload|force-reload)
            #
            # If do_reload() is not implemented then leave this commented out
            # and leave 'force-reload' as an alias for 'restart'.
            #
            #log_daemon_msg "Reloading $DESC" "$NAME"
            #do_reload
            #log_end_msg $?
            #;;
      restart|force-reload)
            #
            # If the "reload" option is implemented then remove the
            # 'force-reload' alias
            #
            log_daemon_msg "Restarting $DESC" "$NAME"
            do_stop
            case "$?" in
              0|1)
                    do_start
                    case "$?" in
                            0) log_end_msg 0 ;;
                            1) log_end_msg 1 ;; # Old process is still running
                            *) log_end_msg 1 ;; # Failed to start
                    esac
                    ;;
              *)
                    # Failed to stop
                    log_end_msg 1
                    ;;
            esac
            ;;
      status)
            status_of_proc $DAEMON $NAME && exit 0 || exit $?
            ;;
      *)
            #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
            echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
            exit 3
            ;;
    esac
    
    :
    

    The second one was modified around the time I was trying to fix it.

    However now it's starting fine on reboot.  *sigh*


  • NetXMS and Fail2Ban
    M MHammett
    Support

    I'm trying to find a way to use Fail2Ban in conjunction with my centralized syslogging that NetXMS already does. However, I don't see a way to point Fail2Ban at NetXMS's database and I don't see a way to get NetXMS to save syslog to save to a file so that I can use standard Fail2Ban methods.


  • Startup Script
    M MHammett
    Support

    I've also tried via systemctl.

    root@netXMS:/etc/init.d# systemctl start netxmsd
    root@netXMS:/etc/init.d# systemctl status netxmsd
    â netxmsd.service - LSB: NetXMS server
       Loaded: loaded (/etc/init.d/netxmsd)
       Active: active (exited) since Fri 2016-11-11 08:07:06 CST; 4min 58s ago
    
    Nov 11 08:07:06 netXMS systemd[1]: Started LSB: NetXMS server initscript.
    Nov 11 08:08:47 netXMS systemd[1]: Started LSB: NetXMS server initscript.
    Nov 11 08:08:59 netXMS systemd[1]: Started LSB: NetXMS server.
    Nov 11 08:12:02 netXMS systemd[1]: Started LSB: NetXMS server.
    root@netXMS:/etc/init.d# ps aux | grep net
    root        28  0.0  0.0      0     0 ?        S<   Oct16   0:00 [netns]
    root     19584  0.0  0.0   5844   712 pts/0    S+   08:07   0:00 tail -f -n 50 /var/log/netxmsd.log
    root     19616  0.0  0.0  12732  2304 pts/2    S+   08:12   0:00 grep net
    

  • Startup Script
    M MHammett
    Support

    I have discovered that my startup script on Debian 8.6 isn't working. It works fine when I run netxmsd directly, but not when I run it via /etc/init.d/netxmsd start. There are no log entries made that way.

    Can I get someone's verified working script so that I can get mine running again?


  • android agent
    M MHammett
    Support

    Anything else you need to do?

    Created user, put in Admins group, gave login as mobile device, added password, added mobile device object, entered the Device ID as I see it in the app, added the user there, gave it all rights.

    I don't see where the device ID went so I can't verify I entered it correctly.

    Error:

    199 13.09.2015 16:30:35 SECURITY [redacted] 128 [redacted] Mobile device login as user "[redacted]" failed with error code 2 (client info: n/a)

    It didn't like the password. I entered the LastPass generated password (copy + paste) and it didn't like it. I changed it to a simple password and it took that.


  • NetXMS video tutorial series
    M MHammett
    Support

    Tomas, I would like a video tutorial on how to be awesome like you. You've done so much with this, it's a beacon for netXMS. If it weren't for Tomas's help and videos...  I would have looked at it, maybe installed it and moved on due to difficulty in figuring out how to use it. I  know all of the great things Tomas has done with NetXMS, so I plow ahead know he'll light my path.

  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups