Questions Tagged With system-administrationhttp://linuxexchange.org/tags/system-administration/?type=rssquestions tagged <span class="tag">system-administration</span>enSat, 05 Mar 2011 12:17:18 -0500cat file in a php pagehttp://linuxexchange.org/questions/1502/cat-file-in-a-php-page<p>Is there a way to make a php script so that <a href="http://view_log.php" rel="nofollow">http://view_log.php</a> wil display the content of a log file in /var/logs/something.log? Im running Apache and latest php....</p>ygdrazilSat, 05 Mar 2011 12:17:18 -0500http://linuxexchange.org/questions/1502/cat-file-in-a-php-pagesystem-administrationkernel for 8 core XEONhttp://linuxexchange.org/questions/1329/kernel-for-8-core-xeon<p>Hi, I have started using the xeon for large intensive jobs. However, only 1 core runs at 100percent. The rest at ~20. My software is for all 8cores. The developer says it's a Linux issue.</p> <p>On reading it appears Ubuntu isn't ready for 8cores by default and I need to rebuild the kernel. This isn't a prob. However, before starting will someone pls tell me is it ok to find the current ker. source and re configure rather than worry about supporting all necessary drivers in a new file?</p> <p>Or, is there a better Linux distro for parallel use? I used Gentoo for years so rebuilding is easy. But will someone advise me on this since I don't want any mistakes with Ubuntu?</p> <p>Thank you. Gav.</p>Dr. Gavin SeddonWed, 01 Sep 2010 09:36:09 -0400http://linuxexchange.org/questions/1329/kernel-for-8-core-xeonsystem-administrationkernelsmpProcessing passed arguments in scripthttp://linuxexchange.org/questions/1130/processing-passed-arguments-in-script<p>I'm trying to decide between short and long options, such as:</p> <p>-h </p> <p>vs.</p> <p>--help</p> <p>Obviously there are packages that deal with this, particularly in shell and perl programming.</p> <p>Getopts, Getopts::Std, and Getopts::Long</p> <p>I would prefer to use both, both -h and --help being a call for a help/usage function, but that requires quite a bit more effort.</p> <p>So my question is, what are the pros and cons of both, while I like the readability of the long notation, it's also nice and cleaner to be able to use just the simple single character flags.</p>rfelsburgFri, 23 Jul 2010 15:37:51 -0400http://linuxexchange.org/questions/1130/processing-passed-arguments-in-scriptprogrammingscriptingsystem-administrationbashconfigurationNagios SCHEDULE_FORCED_HOST_CHECK not runninghttp://linuxexchange.org/questions/1108/nagios-schedule_forced_host_check-not-running<p>In nagios, when I force a host check, I can clearly see in the logs:</p> <pre><code>[1279640879] EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;random-host.domain.org;1279640878 </code></pre> <p>However it never actually runs the check-host-alive check, which is check_ping.</p> <p>It doesn't appear in the scheduling queue, and even though the host in not pingable, and running the command itself fails it still shows as being up.</p> <pre><code>/usr/local/nagios/libexec/check_ping -H random-host.domain.org -w 3000.0,80% -c 5000.0,100% -p 1 CRITICAL - Host Unreachable (random-host.domain.org) Host Status: UP Status Information: PING OK - Packet loss = 0%, RTA = 1.10 ms Performance Data: Current Attempt: 1/10 State Type: HARD Last Check Type: ACTIVE Last Check Time: 07-19-2010 16:02:03 Status Data Age: 0d 0h 0m 30s Next Scheduled Active Check: N/A Latency: 0.000 seconds Check Duration: 0.053 seconds Last State Change: 04-01-2009 15:58:50 Current State Duration: 474d 0h 3m 43s Last Host Notification: N/A Current Notification Number: 0 Is This Host Flapping? NO Percent State Change: 0.00% In Scheduled Downtime? NO Last Update: 07-19-2010 16:02:25 </code></pre> <p>I can grep back through my archive logs, and see where hosts have been reported down however the above host was down for almost 30 minutes and we still received no alert:</p> <pre><code>HOST ALERT: some-other-random-host.org;DOWN;SOFT;1;CRITICAL - Host Unreachable (some-other-random-host.org) </code></pre> <p>My host and check-host-alive settings are:</p> <pre><code>define host{ name linuxprod-server use generic-host check_period 24x7 max_check_attempts 10 check_command check-host-alive notification_period 24x7 notification_interval 120 notification_options d,u,r contact_groups linux admins register 0 } </code></pre> <p>and check-host-alive is defined here:</p> <pre><code># 'check-host-alive' command definition define command{ command_name check-host-alive command_line $USER1$/check_ping -H $HOSTALIAS$ -w 3000.0,80% -c 5000.0,100% -p 1 } </code></pre> <p>Thoughts?</p>rfelsburgTue, 20 Jul 2010 16:04:48 -0400http://linuxexchange.org/questions/1108/nagios-schedule_forced_host_check-not-runningnagiosnot-executesystem-administrationlinuxqueueTool for tracking user's usage of a Linux systemhttp://linuxexchange.org/questions/827/tool-for-tracking-users-usage-of-a-linux-system<p>I am looking for a tool that monitors my system and informs me when a user logs in... someone attempts to login, etc. I know I can create a cron job to check "who" or "w" every so often but I was wondering if anyone was aware of a more proactive approach and/or tool.</p>AndyThu, 10 Jun 2010 15:10:08 -0400http://linuxexchange.org/questions/827/tool-for-tracking-users-usage-of-a-linux-systemcrontabsystem-administrationBest practices for geo-redundancy?http://linuxexchange.org/questions/768/best-practices-for-geo-redundancy<p>We have a Lighttpd/Perl/MySQL web service we run on an Ubuntu VPS, and want to add redundacy so that if our datacenter has issues, we stay up.</p> <p>Interested in thoughts and comments on our proposed solution:</p> <ul> <li><p>We're looking at using GlusterFS to mirror the web roots and config files for our apps, and MySQL Replication in multimaster mode to mirror the database. Both would run over the WAN/Public Internet between the two datacenters with IPSec Transport mode encryption.</p></li> <li><p>We'd use dual A records (an IP at each datacenter) to host the sites. This would provide for round-robin while things were working, and would failover within 4 seconds (worst case, most browsers release a DNS pinning in 1000ms) to the other server, should connectivity be lost.</p></li> <li><p>GlusterFS and MySQL replication would both "self heal" and update the other server automatically once connectivity was restored, so there is no issue of needing to update an out-of-sync server after failover, and both servers can run in "live mode" with both A records live all the time - so there is no DNS propagation to take place to make a failover happen.</p></li> <li><p>In the event of software failure or a need to take one server offline for maintenance (rather than connectivity failure) we could simply pull one server's IP offline using the VPS control panel, or firewall it temporarily with iptables on the server itself.</p></li> <li><p>As well as the automatic failover we'd experience with a datacenter outage, we could also automatically initiate a failover in the event of software failure on one server using automatic monitoring - if one server isn't returning the content we expect to see, we would get an alert, and the monitoring software would automatically pull the offending server offline using the VPS host's API - causing requests to fail over to the other.</p></li> </ul> <p>Interested to know if anyone has tried doing anything similar, or for any thoughts, comments or suggestions on the above strategy.</p>JefferyWed, 02 Jun 2010 20:57:56 -0400http://linuxexchange.org/questions/768/best-practices-for-geo-redundancylinuxsystem-administrationDetecting A Compromised Hosthttp://linuxexchange.org/questions/391/detecting-a-compromised-host<p>Okay so you have installed your distribution of choice and done all of the recommended hardening security steps such as encrypted paritions, configured your firewall (iptables/tcpwrappers), installed a file integrity checker/host intrusion detection system (tripwire, samhain, ossec). You also regularly check for rootkits using tools such as (rkhunter, chkrootkit) and audit/harden your machine following (lynsis / bastilles) recommendations. Only running services which are necessary and disable any which are surplus to requirements. Keeping up to date with security patches, maintaining good file system permissions and regularly reading your system logs.</p> <p>Although the above is not a fully comprehensive list, If you have implemented the above chances are your in pretty good shape. However my question is what additional steps do you take to protect/prevent your host/network from becoming compromised and more importantly if it was how quickly would you know about it? </p> <p>For example here is a few things that I personally do on my Linux boxes.</p> <ul> <li>Create an MD5 hash of my currently running iptables check this every 15 minutes if it has changed something has been added/removed.</li> <li>I create separate partitions for various mount points such as (/var,/usr,/tmp,/boot,/home) etc and use mount options such as NOSUID, NOEXEC, READONLY. I then check every 15 minutes and compare the current mount options to ensure none of them have changed, If one of them suddenly writable I want to know about it. </li> <li>Monitor netstat's output for listening services and comparing this against a file which contains a list of known good services/ports which I have approved. If any new services start listening I will be informed and can check whether this is legitimate or a potential backdoor.</li> <li>Perform a daily scan of my local home network using nmap/ndiff to detect any foreign hosts or determine if any other hosts are listening for new services.</li> <li>Implement and check that critical files (/etc/passwd, /etc/shadow, /etc/group ...) are immutable (chattr +i).</li> </ul> <p>The above checks can be performed regularly using a cronjob. Obviously if someone roots the box swiftly some of these checks are going to be useless if the attacker gets an opportunity to disable them. Although if you have more than one Linux box you can configure them to check on each other which adds an additional layer of protection.</p> <p>I am keen to know what the rest of the community does and any funky hurdles they place to trip an attacker up?</p>gjcwilliamsSat, 08 May 2010 12:54:50 -0400http://linuxexchange.org/questions/391/detecting-a-compromised-hostsecuritylinuxsystem-administrationWhat shells are available on the box ?http://linuxexchange.org/questions/160/what-shells-are-available-on-the-box<p>Hi,</p> <p>Is there a way to determine what shells are available on a Linux box other than trying out <em>/bin/shellname</em> ?</p> <p>Even a workaround would do :)</p> <p>Thanks.</p>Knight SamarMon, 03 May 2010 08:16:53 -0400http://linuxexchange.org/questions/160/what-shells-are-available-on-the-boxshellsystem-administration