Koozali.org: home of the SME Server

viewing logs from the web without logining into server-manager

Offline purvis

  • *****
  • 567
  • +0/-0
viewing logs from the web without logining into server-manager
« on: October 16, 2009, 03:30:30 AM »
i
 would like to review some logs, in particular the raidmonitor/current log from a web page
the command from putty goes like this
cat /var/log/raidmonitor/current | tai64nlocal


in php this does work
system("cat /var/log/raidmonitor/current | tai64nlocal | col -b",$return);
print "\n";

but you have to change the "/var/log/raidmonitor" directory with chmod

what chmod number would be good to set the directory /var/log/raidmonitor  to for this to work and be safe too?

thanks
paul




Offline purvis

  • *****
  • 567
  • +0/-0
Re: viewing logs from the web without logining into server-manager
« Reply #1 on: October 16, 2009, 11:33:05 PM »
ok i used  "chmod 775 /var/log/raidmonitor" so i could monitor the current raidmonitor log

Code: [Select]
<!--DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"-->
<html>
<head><title>Server Status</title></head>
<body>
<tt>
<b>
<div>
<?php
print "<pre>";
echo  
'<font size="4">';
print 
"Server Status Report\n";
print 
"\n";
print 
"Current date : ";
system("date +'%m-%d-%Y  %T %Z' | col -b",$return);
print 
"    URL name : ";
print  (
$_SERVER['SERVER_NAME']);
print 
"\n";
print 
" Server name : ";
system("uname -n | col -b",$return);

print 
"************** UPTIME ***************\n";
system("uptime | col -b",$return);
print 
"\n";

print 
"\n";
print 
"************** RAID STATUS **********\n";
system("cat /proc/mdstat | col -b",$return);
print 
"\n";

print 
"************** DISK STATUS **********\n";
// system("df -h | col -b",$return);
system("df  | col -b",$return);
print 
"\n";


print 
"************** RAIDMONITOR LOG*******\n";
//system("cat /var/log/raidmonitor/current | tai64nlocal | col -b",$return);
system("cat /var/log/raidmonitor/current | tai64nlocal | col -b",$return);
print 
"\n";



print 
"\n---end of report---\n";
print 
"</pre>";
?>

</div>
</body>
</html>


Offline purvis

  • *****
  • 567
  • +0/-0
Re: viewing logs from the web without logining into server-manager
« Reply #2 on: October 16, 2009, 11:45:24 PM »
my raidmonitor current log looked like this
Code: [Select]
2008-09-07 17:00:18.036889500 mdadm: ARRAY line /dev/md2 has no identity information.
2008-09-07 17:00:18.036962500 mdadm: ARRAY line /dev/md1 has no identity information.
2008-09-07 17:00:18.445163500 Event: NewArray, Device: /dev/md2, Member:
2008-09-07 17:00:18.602383500 Event: NewArray, Device: /dev/md1, Member:
2008-09-07 17:00:18.828141500 Event: DegradedArray, Device: /dev/md2, Member:
2009-06-19 00:48:05.154605500 mdadm: ARRAY line /dev/md2 has no identity information.
2009-06-19 00:48:05.161249500 mdadm: ARRAY line /dev/md1 has no identity information.
2009-06-19 00:48:05.333236500 Event: NewArray, Device: /dev/md2, Member:
2009-06-19 00:48:05.487753500 Event: NewArray, Device: /dev/md1, Member:
2009-06-19 00:48:05.675735500 Event: DegradedArray, Device: /dev/md2, Member:
2009-06-19 00:57:25.187917500 mdadm: ARRAY line /dev/md2 has no identity information.
2009-06-19 00:57:25.194452500 mdadm: ARRAY line /dev/md1 has no identity information.
2009-06-19 00:57:25.364169500 Event: NewArray, Device: /dev/md2, Member:
2009-06-19 00:57:25.519344500 Event: NewArray, Device: /dev/md1, Member:
2009-06-19 00:57:25.709007500 Event: DegradedArray, Device: /dev/md2, Member:
2009-06-19 01:02:38.385219500 mdadm: ARRAY line /dev/md2 has no identity information.
2009-06-19 01:02:38.385226500 mdadm: ARRAY line /dev/md1 has no identity information.
2009-06-19 01:02:39.187495500 Event: NewArray, Device: /dev/md2, Member:
2009-06-19 01:02:39.335145500 Event: NewArray, Device: /dev/md1, Member:
2009-06-19 01:02:39.529567500 Event: DegradedArray, Device: /dev/md2, Member:
2009-06-19 02:19:39.042141500 Event: RebuildStarted, Device: /dev/md2, Member:
2009-06-19 02:36:39.121062500 Event: Rebuild20, Device: /dev/md2, Member:
2009-06-19 02:54:39.189260500 Event: Rebuild40, Device: /dev/md2, Member:
2009-06-19 03:13:39.265306500 Event: Rebuild60, Device: /dev/md2, Member:
2009-06-19 03:34:39.341995500 Event: Rebuild80, Device: /dev/md2, Member:
2009-06-19 03:59:39.369684500 Event: RebuildFinished, Device: /dev/md2, Member:
2009-06-19 03:59:39.573258500 Event: SpareActive, Device: /dev/md2, Member: /dev/sdb2
2009-06-26 17:48:38.212428500 mdadm: ARRAY line /dev/md2 has no identity information.
2009-06-26 17:48:38.212435500 mdadm: ARRAY line /dev/md1 has no identity information.
2009-06-26 17:48:38.397679500 Event: NewArray, Device: /dev/md2, Member:
2009-06-26 17:48:38.539864500 Event: NewArray, Device: /dev/md1, Member:
2009-06-26 18:11:03.894950500 mdadm: ARRAY line /dev/md2 has no identity information.
2009-06-26 18:11:03.894956500 mdadm: ARRAY line /dev/md1 has no identity information.
2009-06-26 18:11:04.060721500 Event: NewArray, Device: /dev/md2, Member:
2009-06-26 18:11:04.202399500 Event: NewArray, Device: /dev/md1, Member:
2009-06-26 18:15:31.667514500 mdadm: ARRAY line /dev/md2 has no identity information.
2009-06-26 18:15:31.675442500 mdadm: ARRAY line /dev/md1 has no identity information.
2009-06-26 18:15:32.349615500 Event: NewArray, Device: /dev/md2, Member:
2009-06-26 18:15:32.507021500 Event: NewArray, Device: /dev/md1, Member:
2009-07-08 21:54:08.836301500 mdadm: ARRAY line /dev/md2 has no identity information.
2009-07-08 21:54:08.836309500 mdadm: ARRAY line /dev/md1 has no identity information.
2009-07-08 21:54:08.997544500 Event: NewArray, Device: /dev/md2, Member:
2009-07-08 21:54:09.146685500 Event: NewArray, Device: /dev/md1, Member:
2009-08-07 20:48:21.615538500 mdadm: ARRAY line /dev/md2 has no identity information.
2009-08-07 20:48:21.615546500 mdadm: ARRAY line /dev/md1 has no identity information.
2009-08-07 20:48:21.774484500 Event: NewArray, Device: /dev/md2, Member:
2009-08-07 20:48:21.914925500 Event: NewArray, Device: /dev/md1, Member:
2009-08-24 20:45:17.945629500 mdadm: ARRAY line /dev/md2 has no identity information.
2009-08-24 20:45:17.954953500 mdadm: ARRAY line /dev/md1 has no identity information.
2009-08-24 20:45:18.160910500 Event: NewArray, Device: /dev/md2, Member:
2009-08-24 20:45:18.302175500 Event: NewArray, Device: /dev/md1, Member:
2009-10-13 17:40:41.155321500 mdadm: ARRAY line /dev/md2 has no identity information.
2009-10-13 17:40:41.155328500 mdadm: ARRAY line /dev/md1 has no identity information.
2009-10-13 17:40:41.383236500 Event: NewArray, Device: /dev/md2, Member:
2009-10-13 17:40:41.521335500 Event: NewArray, Device: /dev/md1, Member:

i did get two emails that where read late about the degraded arrays.
i have only two hard drives running in a raid1 array
i do not understand the 4 lines

 mdadm: ARRAY line /dev/md2 has no identity information.
 mdadm: ARRAY line /dev/md1 has no identity information.
 Event: NewArray, Device: /dev/md2, Member:
 Event: NewArray, Device: /dev/md1, Member:

but i am replacing the 2 hard drives with new drives anyways because i have had some troubles and cannot detect what happened.
as it occured while checking the two wd 300gig drives, they where not identical as i might of thought.
the versions of the firmware was different enough for me to go ahead and change the drives.
we did have a computer glitch on august 3, 2009 and some data was not right. i do not know what caused the glitch, workstation, server, or network devices, just swapping out drives makes me more comfortable at this time.

 


Offline purvis

  • *****
  • 567
  • +0/-0
Re: viewing logs from the web without logining into server-manager
« Reply #3 on: October 20, 2009, 06:52:39 PM »
I never could find out why i kept getting these messages in the the raidmonitor log, except for yes, during the bootup process, the computer could not find the raid1, but then it would adjust itself somehow during the boot process to bring the raid1 online.

When i installed this sme server over a year ago, i had probably installed sme server about 50 times or so at least, will all the practices installs and reinstalls of servers, we actually only have 7 sme servers actually running. It was hard to believe when i installed the sme server i did not chose the proper setup for me(raid1 and no spare). The two drives where the original hard drives placed into service on that sme server.

I decided i did not want to live with the current situation that existed, then made the plunge to go ahead and backup and reinstall sme server 7.4 from scratch on two brand new hard drives with the exact product ids.

One thing i want to add, i had gotten the two previous hard drives from two new computers that had the same size 250 gig western digital hard drives.  I had some problems with degraded arrays twice in the past, once for sure.  In running some of the SMART testing, i found out that the two drives where different in firmware by a version number, something like one had (fake numbers here) 1.15 and the other had 2.015, just understand they had different firmware but everything else seemed the same. The drives checked out ok by the test i ran, but i removed them anyways.

The newer drives are much faster, you can see that during the raid1 rebuilds because i first tried to move from the older drives to the newer drives, then do a grow procedure, hoping that would of solved the message problems i was getting before, but it did not, but i was able to see the transfer speed during the rebuilding stages and do some mental comparing. So to refresh you, i just reinstalled the sme server on the two new hard drives, Seagate 500 gig, 7200 rpms, with exact product ids. I think there is 32m cache on the drives as well.


Now can you believe it, i reinstalled and picked(typed in) the NOSPARE option and i am now getting a message that no spare exist in the raidmonitor log file.

But i can live with this message much better than the messages i was seeing before that you can see from above.

Code: [Select]
2009-10-17 04:41:15.123844500 Event: SparesMissing, Device: /dev/md1, Member:
2009-10-17 04:41:15.557335500 Event: SparesMissing, Device: /dev/md2, Member:


 

« Last Edit: October 20, 2009, 07:09:52 PM by purvis »

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: viewing logs from the web without logining into server-manager
« Reply #4 on: October 20, 2009, 07:08:20 PM »
purvis: what about posting also in bugzilla? I sincerely don't know if such a log is normal or not, but if something is wrong, please go to bugzilla

thank you

Offline purvis

  • *****
  • 567
  • +0/-0
Re: viewing logs from the web without logining into server-manager
« Reply #5 on: October 20, 2009, 07:11:41 PM »
Until i know it is a bug for sure, i do not want to report it there.  There is always a human doing this, and i do make mistakes.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: viewing logs from the web without logining into server-manager
« Reply #6 on: October 21, 2009, 02:19:49 AM »
Until i know it is a bug for sure, i do not want to report it there.

Wrong.

Don't report problems here - Please report bugs and potential bugs in the bug tracker

Offline steve288

  • *
  • 336
  • +0/-0
Re: viewing logs from the web without logining into server-manager
« Reply #7 on: October 21, 2009, 04:52:21 PM »
Another option to notify you of potential problems eg raid or many other issues, is to have the log file emailed to you if there is a problem.

How.
Set up a cron job to run a script to grep the log file for a string. eg "Failed drive" (if thats the error) then when it finds the string, (if true) then zip up the log file and email the attachment to yourself.

Or
A manual way of sending log files to yourself could be to use procmail. Set up a procmail recipe that you have set up to run the same script as above or a different one. When it gets an email from yourname@yourdomain.com and has the words SENDME_mail.log_!@#$ it starts an executable and mails the log file to your address, or even if you want (like a vacation message) to the address you are mailing from.

You can add many security checks so only you get this email. I have used this and find it very useful for remotely checking on things.  It also gives you the ability to save the logs in your email if you want to refer back to them again off line.

Regards

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: viewing logs from the web without logining into server-manager
« Reply #8 on: October 21, 2009, 04:58:49 PM »
Another option to notify you of potential problems eg raid or many other issues, is to have the log file emailed to you if there is a problem.

Notifications of status change in the raid system is already sent via email.

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: viewing logs from the web without logining into server-manager
« Reply #9 on: October 21, 2009, 04:59:21 PM »
Another option to notify you of potential problems eg raid or many other issues, is to have the log file emailed to you if there is a problem.

you don't need anything else than forwarding admin's mails to your account

every time your server has a problem (raid,disk,av updates ecc) you will receive a mail

Stefano and K.I.S.S. philosopy

Offline purvis

  • *****
  • 567
  • +0/-0
Re: viewing logs from the web without logining into server-manager
« Reply #10 on: October 26, 2009, 04:16:35 AM »
I think i reported in my previous post in this thread that i was and did replace the two hard drives in my raid1 setup.

But i wanted to make a final report so that others can learn from my experience.


I did do some test on the both drives while they where running in raid1.
while both drives where running, i was getting normal raid1 reports from the mdadm report that reports the two "UU"'s that mean everything is good.
 But in my raidmonitor log, i was this
2009-10-13 17:40:41.155321500 mdadm: ARRAY line /dev/md2 has no identity information.
2009-10-13 17:40:41.155328500 mdadm: ARRAY line /dev/md1 has no identity information.
2009-10-13 17:40:41.383236500 Event: NewArray, Device: /dev/md2, Member:
2009-10-13 17:40:41.521335500 Event: NewArray, Device: /dev/md1, Member:

and i did not like it.
i did do some S.M.A.R.T checking while the two drives where running and i did not get any negative reports that i could detect.

during the boot up process i would get a message that raid1 was not detected and then it would kick in so to say.
Well i just did not trust anything i was seeing or i just did not know how to find out what was actually going on.
But you can be your sweet ???, i was not going to wait around for something to go from bad to worst.
So i did replace and upgrade both the drives.
I ended up just reinstalling the sme server operating system from scratch because i still did not like the what the raidmonitor was reporting and i do not even remember what it said.


Now get this.

I had the two drives i removed, in doing a raid rebuild on the first try of installing the first new drive, i had to remove one drive right,  so i removed the drive i thought might of been the one that gave me problems in the past, one i had to resync.

So with two new hard drives working now, i removed them and installed the first drive i had removed from the previous setup.
Can you believe it, that sucker was not even recognized by my computer, even though it was spinning and hooked up. After a while i started tapping and hitting it to see if there where sticking heads on the drive. Well basically i never did get my computer to recognize that drive and now it is in the trash can. Now this drive has been out over a week from my computer.

All this being said and what i have to wonder about is. Was my computer recognizing this drive when i was first seeing the strange messages in the raidmonitor. It would of been so simple to go into the bios and check,  but i did not. I really do not know.  And if i would of let the computer cool down by turning off the computer and letting it just sit, i might of found a problem with this drive then.

Once again, i only found out this problem because i was going to place the drive in the computer as a single drive and reload the sme server operating system to test something else , and the drive does not work now, period.

I never did lose anything, thank god.  Next time a drive has problems, check your bios and also let the drive sit for awhile and see if it spins back up and displays in the computers bios setting. That would of been a simple test for drives giving weird signals to us by various means.