How to check syslog running Unix/Linux


This  script checked  If  syslog is running properly. In some cases syslog can be hanged  or  syslog process  can be  stopped.You need to fix this  issue  because  of  getting  logs about  server. When  a  problem occurs  syslog  messages can be really   helpful to fix problem.

#!/bin/ksh
Solaris_SYSLOG_TEST() {
if svcs svc:/system/system-log:default |/usr/xpg4/bin/grep -q “online” >/dev/null 2>&1
then
DATE=date +"%Y_%m_%d"
TEST=echo "UNIXFORZA_$DATE"
logger -p local0.error $TEST
if cat /var/adm/messages|/usr/xpg4/bin/grep -q $TEST >/dev/null 2>&1
then
DEG=echo " RUNNING"
else
DEG=echo " HANGED"
fi
else
DEG=echo " STOPPED"
fi
}
HP_SYSLOG_TEST() {
if ps -ef|grep syslog|grep -v grep |grep -q “syslogd” >/dev/null 2>&1
then
DATE=date +"%Y_%m_%d"
TEST=echo "UNIXFORZA_$DATE"
logger -p user.info $TEST
if cat /var/adm/syslog/syslog.log|grep -q $TEST >/dev/null 2>&1
then
DEG=echo " RUNNING"
else
DEG=echo " HANGED"
fi
else
DEG=echo " STOPPED"
fi
}
REDHAT_SYSLOG_TEST() {
if ps -ef|grep -v grep|grep -q “syslogd” >/dev/null 2>&1
then
DATE=date +"%Y_%m_%d"
TEST=echo "UNIXFORZA_$DATE"
logger -p user.info $TEST
if cat /var/log/messages|grep -q $TEST >/dev/null 2>&1
then
DEG=echo " RUNNING"
else
DEG=echo " HANGED"
fi
else
DEG=echo " STOPPED"
fi
}
OS=uname -s
case “$OS” in
“SunOS”)
Solaris_SYSLOG_TEST
printf “%-20s%-20s%-20s\n” “hostname” “|Syslog State” “|$DEG”
;;
“Linux”)
REDHAT_SYSLOG_TEST
printf “%-20s%-20s%-20s\n” “hostname” “|Syslog State” “|$DEG”
;;
“HP-UX”)
HP_SYSLOG_TEST
printf “%-20s%-20s%-20s\n” “hostname” “|Syslog State” “|$DEG”
;;
esac

 

Tagged In:

I'm a IT Infrastructure and Operations Architect with extensive experience and administration skills and works for Turk Telekom. I provide hardware and software support for the IT Infrastructure and Operations tasks.

205 Total Posts
Follow Me

55 Comments

  1. Informed consent was initially obtained only for the screening interview. http://saleviabuy.com viagra pill

  2. Acoustic neuromas usually grow slowly over a period of years. https://genqpviag.com buying generic viagra in australia

  3. While some phospholipases possess substrate specificity for certain phospholipid species, some can catalyze the cleavage of other lipophillic molecules such as triacylglycerols in addition to phospholipids. when will generic viagra be available in the us (genqpviag.com) reviews of generic viagra

  4. Children in this age group who are getting vaccinated for the first time will need two doses. https://llviabest.com viagra order online

  5. Normal colorectal mucosa is seen on the right. https://siviagmen.com viagra samples online

  6. Alprostadil is also produced in the form of special suppositories, inserted http://genqpviag.com generic viagra 100mg

  7. Not for looking up medical abbreviations. where can i buy generic viagra generic viagra 100

  8. For some people, however, anxiety becomes so frequent, or so forceful, that it begins to take over their lives. http://genqpviag.com does online generic viagra work

  9. The experienced, collaborative team of specialists at NorthShore Kellogg Cancer Center combines the most advanced scientific knowledge and technology with a comprehensive and compassionate approach to care, creating a program of personalized medicine and patient-centered care for each individual diagnosed with ovarian cancer. best online pharmacy for viagra review (llviabest.com) viagra deals online

  10. Plantar fasciitis is essentially, the tearing and inflammation and subsequent deterioration of a long ligament type structure in the bottom of the foot. is it legal to buy viagra online get a viagra prescription online

  11. Oral medications include (sildenafil) and Levitra (vardenafil), which work by enhancing the effects of nitric oxide, a chemical that increases blood flow in the penis. These drugs are taken about an hour before sexual activity. They should not be used more than once a day, and men who take nitrate-based drugs such as nitroglycerin for heart problems should not use them because they can cause a sudden drop in high blood pressure. buy generic viagra online with mastercard (llviabest.com) buy viagra online legitimate

  12. Hemorrhagic strokes are divided into two main categories: Intracerebral hemorrhage is caused when an abnormal artery within the brain bursts, flooding the surrounding brain tissue with blood. best generic viagra online what does a generic viagra pill look like

  13. can you buy real viagra online http://usggrxmed.com/ buy female viagra online where to buy generic viagra online

  14. recently identified groups more likely to abuse http://siviagmen.com is it legal to buy viagra online

  15. viagra generic review http://fmedrx.com/ india generic viagra order generic viagra online

  16. Taking too much of any medication increases your risk of an overdose. https://siviagmen.com viagra online with prescription

  17. In rare cases, hanging skin may be related to excess neck skin that probably would have been better treated with a facelift procedure. viagra online store brand viagra online

  18. viagra india https://paradiseviagira.com generic viagra forum

  19. where do you buy viagra in melbourne generic viagra cost pfirer viagra

  20. pink viagra pfizer viagra und fitness es delito vender viagra

  21. efecte secundare la viagra purevigra.com viagra online caution

  22. gold ag edhe viagra me pi buybuyviamen.com viagra pour homme pas cher

  23. how to take soft viagra tabs immagini viagra divertenti generic viagra bad

  24. Cheap sildenafil canada https://lightvigra.com/ sildenafil canadian online pharmacy

  25. Viagra generic india https://mygoviagar.com where to buy viagra pills online

  26. Viagra generic from india https://mygoviagar.com order viagra professional

  27. Order viagra online usa https://lightvigra.com viagra price online

  28. order no prescription viagra buy viagra gel viagra prescription coupon

  29. Female viagra pill price miraclevigra.com where to buy viagra in mexico

  30. Buy viagra tablet india online miraclevigra.com buy sildenafil india online

  31. Purchase viagra with paypal https://mygoviagar.com/ average cost of viagra 100mg

  32. Women viagra pills https://mygoviagar.com cheap viagra online india pharmacy

  33. Sildenafil generic discount miraclevigra.com order sildenafil citrate

  34. Generic sildenafil in usa mygoviagar.com buy viagra 100 mg online

  35. Buy sildenafil 100mg https://mygoviagar.com/ buy viagra brand online

  36. Buy viagra in usa online mygoviagar.com viagra for women buy online

  37. 100 mg viagra miraclevigra.com can you buy viagra over the counter australia

  38. Canadian viagra coupon https://miraclevigra.com/ 2 viagra pills

  39. Best viagra over the counter https://miraclevigra.com where can i purchase sildenafil

  40. Generic viagra sold in united states miraclevigra.com sildenafil 20 mg over the counter

  41. Best prices sildenafil https://mygoviagar.com generic viagra coupon

  42. Viagra for men https://lightvigra.com viagra price canada

  43. Where to buy viagra in canada safely https://lightvigra.com/ buy generic sildenafil online

  44. 100mg sildenafil no rx https://mygoviagar.com/ sildenafil price canada

  45. Viagra online rx pharmacy https://mygoviagar.com/ viagra pills without prescription

  46. Viagra for sale on line https://mygoviagar.com viagra price comparison

  47. Viagra otc usa mygoviagar.com sildenafil citrate 100 mg

  48. Buy viagra from mexico https://miraclevigra.com/ buy generic viagra online pharmacy

  49. Order sildenafil uk https://miraclevigra.com cost for viagra

  50. Sildenafil canadian online pharmacy https://miraclevigra.com sildenafil online for sale

  51. viagra-50mg pharmacy viagra uk viagra cost in india

  52. buy female viagra from united states where can i buy viagra in canada sildenafil citrate 100

  53. Where can i buy sildenafil online safely https://miraclevigra.com buy generic viagra in usa

  54. Viagra in india online purchase miraclevigra.com cheap viagra pills for sale

  55. sildenafil gel 100 mg pharmacy viagra price purchase viagra uk

Leave a Reply