Author Topic: How to Configure a NetScaler Device to Send Syslog Output to a Remote Serve  (Read 4338 times)

Offline jmelika

  • Administrator
  • Hero Member
  • *****
  • Posts: 339
  • Karma: 7
As of release 6.1 you can configure a remote syslog server from the command line interface (CLI) using the following command:

set audit syslogparams [-serverip <ip_address>] [-serverport <port>]
        [-dateformat ( MMDDYYYY | DDMMYYYY )] [-logLevel <logLevel> ...]

-Where-

    <logLevel> = ( EMERGENCY | ALERT | CRITICAL | ERROR | WARNING | NOTICE |

        INFORMATIONAL | DEBUG | ALL )

For NetScaler release 6.0 or earlier, the following procedure applies:

Assumptions: You want to use the local0 facility to log system events, and the local2 facility to log SSL Virtual Private Networking (VPN) access events. You also want these logs saved locally on your NetScaler device.

   1. Configure /etc/hosts and verify connectivity to the remote syslog server

      > shell
      # su
      Password:
      netscaler# cd /etc/
      netscaler# pico hosts

   2. Add the following line to /etc/hosts:

      <ip address of remote> <hostname>

   3. Save the file (in the Pico editor, press CTRL+O to save the file and CTRL+X to exit the editor itself).
   4. Verify you have done this correctly by pinging the remote device from the shell:

      netscaler# ping <hostname>

   5. Enable syslog on the NetScaler:

      > shell
      # su
      Password:
      netscaler# cd /etc/
      netscaler# pico rc.conf

   6. Look for the following line:

      syslogd_enable=?NO?

   7. Change it to the following:

      syslogd_enable=?YES?

   8. Configure the nsconmsg utility to output log info to syslogd:

      > shell
      # su
      Password:
      netscaler# cd /etc/
      netscaler# pico startpe

   9. Here you are only interested in the section of the file that contains the following:

      #Uncomment the below line to enable Netscaler syslog daemon.
      # $WEBSCALER_START/nsconmsg -s syslog=1 -d eventwait
      #Uncomment the below line to enable Netscaler syslog daemon logs for SSLVPN .
      # $WEBSCALER_START/nsconmsg -s syslog=1 -d accesslogs

  10. Uncomment and modify these lines as follows:

      #Uncomment the below line to enable Netscaler syslog daemon.
      $WEBSCALER_START/nsconmsg -s syslog=1 -d eventwait
      #Uncomment the below line to enable Netscaler syslog daemon logs for SSLVPN .
      $WEBSCALER_START/nsconmsg -s syslogfacility=2 ?s syslog=1 -d accesslogs

  11. Save the file.
  12. Create the actual log files on the NetScaler device itself:

      Note: Again, this is given the assumption that you wish to save local copies of the syslog output on the NetScaler itself.
      > shell
      # su
      Password:
      netscaler# cd /var/log
      netscaler# pico eventlog (this title can be anything you want it to be)

  13. The Pico editor creates a blank file, which you can then save by pressing CTRL+O. Once you have done this, press CTRL+X to exit Pico.
  14. Issue the following command:

      netscaler# pico vpnaccesslog (again, this title can be anything you want it to be)

  15. As above, save the blank file.
  16. Modify the filters in the syslog.conf file:

      Note: The syslog.conf file lists filters that tell the NetScaler device how and where to output syslog data. While there are a number of possible configuration options here, the scope of this FAQ is to stay within our previously defined assumptions.
      > shell
      #su
      Password:
      netscaler# cd /etc/
      netscaler# pico syslog.conf

  17. At the very top of the file, add the following lines:

      local0.* @<hostname>
      local2.* @<hostname>
      local0.* /var/log/eventlog
      local2.* /var/log/vpnaccesslog

  18. Save the file by pressing CTRL+O.
  19. Restart the NetScaler device. Syslog does not start until the device is restarted:

      netscaler# reboot

Note: For High Availability situations, as syslog is handled at the BSD level, it is not affected by the ns.conf configuration synchronization. You must take the preceding steps on both NetScaler devices in the pair.