Ubuntu Server Guide Changes, errors and bugs
Download 1.27 Mb. Pdf ko'rish
|
ubuntu-server-guide
References
This section has just scratched the surface of Nagios’ features. The nagios-plugins-extra and nagios-snmp- plugins contain many more service checks. • For more information see Nagios website. • Specifically the Nagios Online Documentation site. • There is also a list of books related to Nagios and network monitoring: • The Nagios Ubuntu Wiki page also has more details. pam_motd When logging into an Ubuntu server you may have noticed the informative Message Of The Day (MOTD). This information is obtained and displayed using a couple of packages: • landscape-common: provides the core libraries of landscape-client, which is needed to manage systems with Landscape (proprietary). Yet the package also includes the landscape-sysinfo utility which is responsible for displaying core system data involving cpu, memory, disk space, etc. For instance: System l o a d : 0 . 0 P r o c e s s e s : 76 Usage o f / : 30.2% o f 3 . 1 1GB U s e r s l o g g e d i n : 1 Memory u s a g e : 20% IP a d d r e s s f o r e t h 0 : 1 0 . 1 5 3 . 1 0 7 . 1 1 5 Swap u s a g e : 0% Graph t h i s data and manage t h i s system a t h t t p s : / / l a n d s c a p e . c a n o n i c a l . com/ 287 Note You can run landscape-sysinfo manually at any time. • update-notifier-common: provides information on available package updates, impending filesystem checks (fsck), and required reboots (e.g.: after a kernel upgrade). pam_motd executes the scripts in /etc/update−motd.d in order based on the number prepended to the script. The output of the scripts is written to /var/run/motd, keeping the numerical order, then concatenated with /etc/motd.tail. You can add your own dynamic information to the MOTD. For example, to add local weather information: • First, install the weather-util package: sudo apt i n s t a l l weather−u t i l • The weather utility uses METAR data from the National Oceanic and Atmospheric Administration and forecasts from the National Weather Service. In order to find local information you will need the 4-character ICAO location indicator. This can be determined by browsing to the National Weather Service site. Although the National Weather Service is a United States government agency there are weather stations available world wide. However, local weather information for all locations outside the U.S. may not be available. • Create /usr/local/bin/local−weather, a simple shell script to use weather with your local ICAO indi- cator: #!/ b i n / sh # # # P r i n t s t h e l o c a l weather i n f o r m a t i o n f o r t h e MOTD. # # # Re pla c e KINT with your l o c a l weather s t a t i o n . # L o c a l s t a t i o n s can be found h e r e : h t t p : / /www. weather . gov / t g / s i t e l o c . shtml echo weather KINT echo • Make the script executable: sudo chmod 755 / u s r / l o c a l / b i n / l o c a l −weather • Next, create a symlink to /etc/update−motd.d/98−local−weather: sudo l n −s / u s r / l o c a l / b i n / l o c a l −weather / e t c / update−motd . d/98− l o c a l − weather • Finally, exit the server and re-login to view the new MOTD. You should now be greeted with some useful information, and some information about the local weather that may not be quite so useful. Hopefully the local-weather example demonstrates the flexibility of pam_motd. 288 |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling