24. 07. 2005. | #1 |
Web designer
Professional
|
Server status
Ovo moze slobodno da ide u i linux sekciju
Konkretno zanima me kako bi isao output za status servera, pokrenutih servisa i njihov uptime (znaci koliko dugo je vec aktivan taj daemon, tipa apache) Kôd:
<?php function checkd($daemon,$name) { $ps ="ps ax | grep $daemon | wc -l"; $origps = exec($ps); $minone = $origps-2; if ($minone<1) { $dataps = "only <b><font color=red>$minone</font> daemon</b> for <b>$daemon</b>, <br><b><font color=red>$name TOTALY DOWN</font></b><br>"; } if ($minone==1) { $dataps = "<b><font color=blue>up</font></b> only with <b><font color=red>$minone</font> $daemon daemon</b><br>"; } if ($minone>1) { $dataps = "<b><font color=blue>up</font></b> with <b><font color=red>$minone</font> $daemon daemons</b><br>"; } return $dataps; } echo checkd("mysqld","mysql daemon"); echo checkd("httpd","httpd daemon"); ?> |
|
|
Slične teme | ||||
Tema | Početna poruka teme | Forum | Odgovori | Poslednja poruka |
Status servisa na serveru, provera? | pcigre | Web Hosting, web serveri i operativni sistemi | 9 | 22. 01. 2009. 21:11 |
Domen ističe za godinu dana a ima status PENDING DELETE RESTORABLE ?! | Nenad Vasić | Domain Name Service (DNS) | 7 | 30. 06. 2008. 03:22 |
Limundo status nagradne igre | Milos Micic | e-Business | 42 | 13. 06. 2007. 15:44 |
Server vs. UTF-8 | Milos Vukotic | Web Hosting, web serveri i operativni sistemi | 18 | 02. 02. 2006. 00:22 |