Author Topic: Command for viewing logs in /var/nslog and /var/log please help...  (Read 5872 times)

Offline ohmhyde

  • VIP Member
  • ***
  • Posts: 28
  • Karma: 4
Hi everyone.    ;D
with all do respect,
I've installed Netscaler for many customers,
but I still don't know the command to view the logs in /var/nslog  /var/log ( still new to unix)
Sometime serious problems happend which me or customer don't know what causes the problem, Nerscaler or other device.
I also do nstrace too.
So I really need help on this,
Can anyone show me the command and short example.

Thanks very much everyone  in advance....    :  ) 

Offline Marco Schirrmeister

  • Hero Member
  • *****
  • Posts: 101
  • Karma: 14
You can for example run the following command for the newnslog files to get information about the "states" of all your created objects like vservers or services.

/netscaler/nsconmsg -K /var/nslog/newnslog -d event

If a vserver goes down or up you will see it with this command.

Or for all console messages and warnings /netscaler/nsconmsg -K /var/nslog/newnslog -d consmsg

In short, nsconmsg is the command to read the newnslog files.

Here is also a short Citrix article how to get some statistics from the newnslog.
http://support.citrix.com/article/CTX113341


In files in /var/log you can just use view or less to view the content. Or you configure syslog and on the remote syslog server you have a nice tool that can parse syslog output.


Marco

Offline ZManGT

  • VIP Member
  • ***
  • Posts: 94
  • Karma: 12
As an FYI the -K is case sensitive. If you put in a lower case k it will delete the log. So be careful.

Offline Paul B

  • Hero Member
  • *****
  • Posts: 193
  • Karma: 20
The netscaler logs are binary (ie non-human readable) so you have to use the netscaler application "nsconmsg" to extract information. There are many options for the command, and about the only documentation I've ever seen is in the netscaler training course manual!

Many of the commands should only be entered on the day of the full moon, or by people who have scored in excess of 98% in the netscaler exam :-)

Let me cut & paste some examples....

If you want to:
Uncompress an archived log file:   
  gunzip newnslog.21.gz
Discover the time period covered by the log:   
  nsconmsg -K newnslog.21 –d setime
View load-balancing statistics from the archived log: 
  nsconmsg -K newnslog.21 -s ConLb=2 -d oldconmsg
Extract logging information for a shorter duration:   
  nsconmsg -K newnslog.21 -s time=12Jan2006:00:00 -k short_log.nsl -T 1200 -d copy
Start the log process for newnslog:   
  nsconmsg -k /var/nslog/newnslog -T 172800 &

If you want to:
View the time span of the current newnslog file:
nsconmsg -K newnslog -d setime
View the time span of the archived newnslog file:
  zcat filename | nsconmsg -K pipe -d setime
View events in the current newnslog file:
  nsconmsg -K newnslog -d event
View console messages in the current newnslog file:
  nsconmsg -K newnslog -d consmsg
View counter values in the current newnslog file:
  nsconmsg -K newnslog -d stats
View counter values in the current newnslog file:
  nsconmsg -K newnslog -d stats –d current
View non-zero counter values in the current newnslog file:
  nsconmsg -K newnslog -d statswt0 –d current

to display event information, such as entity up/down, alerts and configuration saves in the shell:
  nsconmsg -K newnslog -d event

to display CPU usage in the shell:
  nsconmsg -K newnslog -s totalcount=200 -g cpu_use -d current

to display memory utilization in the shell:
  nsconmsg -s ConMEM=1 -d oldconmsg

to display established HTTP connections in the shell:
  nsconmsg -j server_NSSVC_HTTP_vserver -d current
to display load balancing statistics in the shell:
  nsconmsg -K newnslog –s ConLb=x –d oldconmsg
This command gives basic information when x=1 and detailed information when x=2.

use the following command to view traffic distribution from the shell.
  nsconmsg -K /var/nslog/newnslog -s time -s ConLB=2 -2 distrconmsg

to display load-balancing information in the shell.
  nsconmsg -s ConLb=1 -d oldconmsg

to display monitoring statistics in the shell.
  nsconmsg -K newnslog –s ConMon=x –d oldconmsg
This command gives basic information when x=1 and gives detailed information when x=2.

if you want to:
View SSL stats for front-end connections:
  nsconmsg -K newnslog -s ConSSL=1 -d oldconmsg
View SSL stats for back-end connections:
  nsconmsg -K newnslog -s ConSSL=2 -d oldconmsg
View SSL stats for front and back-end connections:
  nsconmsg -K newnslog -s ConSSL=3 -d oldconmsg

to display content switching statistics in the shell.
  nsconmsg -K newnslog –s ConCSW=1 -d oldconmsg

to display compression statistics in the shell.
  nsconmsg -K newnslog –s ConCMP=x -d oldconmsg
This command gives old compression method related statistics when x=1 and gives new compression method related statistics when x=2

to display integrated caching statistics in the shell.
  nsconmsg -K newnslog -s ConIC=1 -d oldconmsg

Offline ohmhyde

  • VIP Member
  • ***
  • Posts: 28
  • Karma: 4
Thanks again!! Marco  ZManGT...  
and Paul B
that helps alot.
I'll test with my system... 
 ;)