免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2968 | 回复: 2
打印 上一主题 下一主题

万能的CU~~救我。。。syscall.h是什么文件? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-04-12 10:10 |只看该作者 |倒序浏览
在执行perl -MCPAN -e 'install Time::HiRes'的时候,发现make test过不去,有些东西找不到。。。其中一个便是syscall.h。。。。怎么回事。。。。

论坛徽章:
46
15-16赛季CBA联赛之四川
日期:2018-03-27 11:59:132015年亚洲杯之沙特阿拉伯
日期:2015-04-11 17:31:45天蝎座
日期:2015-03-25 16:56:49双鱼座
日期:2015-03-25 16:56:30摩羯座
日期:2015-03-25 16:56:09巳蛇
日期:2015-03-25 16:55:30卯兔
日期:2015-03-25 16:54:29子鼠
日期:2015-03-25 16:53:59申猴
日期:2015-03-25 16:53:29寅虎
日期:2015-03-25 16:52:29羊年新春福章
日期:2015-03-25 16:51:212015亚冠之布里斯班狮吼
日期:2015-07-13 10:44:56
2 [报告]
发表于 2012-04-12 10:21 |只看该作者
这个模块不是 Perl 自带的吗,安装它干嘛

论坛徽章:
0
3 [报告]
发表于 2012-04-12 10:46 |只看该作者
zhlong8 发表于 2012-04-12 10:21
这个模块不是 Perl 自带的吗,安装它干嘛


好吧我离线安装成功了。。。。现在遇到了新的问题,其实我的目的是想用Solarwinds来监控apache的服务状态,现在依然是报错,帮我看一下这个脚本有需要修改的地方么?
  1. #!/usr/bin/perl
  2. #
  3. #
  4. # Copyright ¿ 1999-2008 SolarWinds, Inc. All Rights Reserved.
  5. #
  6. #
  7. use LWP::UserAgent;

  8. if (@ARGV[0] =~ /\bhelp\b/)
  9. {
  10.         print "ServerUptime.pl StatusURL\n";
  11.         print "StatusURL - url to apache server status (ex. www.mysite.com/server-status ) \n";
  12.         exit 1;
  13. }

  14. # Get hostname and trim newline

  15. $localhost = `hostname`;
  16. $localhost =~ s/\s*$//g;
  17. $hostname  = shift || "localhost"; # $localhost

  18. $url = "$hostname/server-status?auto&match=www&errors=0";
  19. # Create a user agent object
  20. $ua = new LWP::UserAgent;
  21. $ua->agent("AgentName/0.1 " . $ua->agent);

  22. # Create a request
  23. my $req = new HTTP::Request GET => "http://$url";
  24. #print "http://$url\n";
  25. $req->content_type("application\/x-www-form-urlencoded");
  26. $req->content("match=www&errors=0");

  27. # Pass request to the user agent and get a response back
  28. my $res = $ua->request($req);
  29. my $val ="";
  30. # Check the outcome of the response
  31. if ($res->is_success) {
  32.         #print $res->content;
  33.         $content = $res->content;
  34.                 while ( $content =~ /Uptime:\s(\d+)/ig){
  35.                         $hour = sprintf("%d",$1 / 3600);
  36.                         $min = sprintf("%d",($1-$hour*3600)/60);
  37.                         $sec = sprintf("%d",($1-$hour*3600-$min*60));
  38.                         $sut = "${hour}h ${min}m ${sec}s";
  39.                         print "Message: Server Uptime at host \"$hostname\" $sut\n";
  40.                         print "statistic:  $1\n";
  41.                         exit 0;
  42.                 }
  43. } else {
  44.        print "Message: unable access to $hostname\n";
  45.         print "Statistic: 0\n";
  46.         exit 1;
  47. }
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP