客户端没有发送keepalive

时间:2015-11-16 12:02:43

标签: sensu

我已经在各个centos机器上安装了sensu服务器,sensu客户端,redis,rabbitmq。我可以看到Sensu客户端的日志用于内存检查,但是sensu服务器和sensu服务器日志中显示的相同:

  

没有从客户端发送保持活动248234秒(> = 180)\“,\”status \“:2,\”history \“:[\”2 \“,\”2 \“,\”2 \”,\ “2 \” \ “2 \” \ “2 \” \ “2 \” \ “2 \” \ “2 \” \ “2 \” \ “2 \” ,\ “2 \” \ “2 \” \ “2 \” \ “2 \” \ “2 \” \ “2 \” \ “2 \” \ “2 \”,\ “2 \” \ “2 \”],\ “total_state_change \”:0},\ “出现\”:8246,\ “动作\”:\ “创建\”,\ “时间戳\”:1447675210}” ]}

我是新手。请求任何人帮助我。谢谢你提前

1 个答案:

答案 0 :(得分:14)

我有同样的问题。我试图从uchiwa手动删除客户端,然后使用curl,并重启sensu-client和sensu-server以及redis。没有成功。然后我在谷歌小组中发现了一些有趣的东西

https://groups.google.com/forum/#!topic/sensu-users/5Z2kVFKZjwQ

似乎如果你主持的时间和日期并不是这样同步的感觉投诉。

所以最后我只是运行了ntpdate命令:

import android.os.Bundle;    

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.Uri;
import android.util.Log;
import android.view.KeyEvent;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.MediaController;
import android.widget.ProgressBar;
import android.widget.VideoView;
import android.os.PowerManager;


    public class VideoPlayback extends Activity {
        private static final String TAG = Dashboard.class.getSimpleName();
        //protected PowerManager.WakeLock mWakeLock;

        ProgressBar progressBar = null;
        VideoView vidView;
        int pos;

        @Override
        public void onSaveInstanceState(Bundle outState) {
            super.onSaveInstanceState(outState);
            pos = vidView.getCurrentPosition();
            vidView.pause();
            outState.putInt("position", pos);
            Log.d("SAVED-POS", String.valueOf(pos));
        }

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            if ( savedInstanceState != null ){
                pos = savedInstanceState.getInt("pos");
            }
            setContentView(R.layout.activity_video_playback);
           getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
            Intent intent = getIntent();
            String message = intent.getStringExtra(Dashboard.EXTRA_MESSAGE);
            String link = "http://" + message;
            vidView = (VideoView) findViewById(R.id.myVideo);
            progressBar = (ProgressBar) findViewById(R.id.progressbar);
            Uri vidUri = Uri.parse(link);
            Log.d(TAG, link);
            vidView.setVideoURI(vidUri);
            try {
                MediaController vidControl = new MediaController(this);
                vidControl.setAnchorView(vidView);
                vidView.setMediaController(vidControl);


            } catch (Exception e) {
                Log.e("Error", e.getMessage());
                e.printStackTrace();
            }
            vidView.requestFocus();
            vidView.start();
            progressBar.setVisibility(vidView.VISIBLE);

            vidView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {

                @Override
                public void onPrepared(MediaPlayer mp) {
                    mp.start();

                    mp.setOnVideoSizeChangedListener(new MediaPlayer.OnVideoSizeChangedListener() {
                        @Override
                        public void onVideoSizeChanged(MediaPlayer mp, int arg1, int arg2) {
                            // TODO Auto-generated method stub
                            Log.d(TAG, "Changed");
                            progressBar.setVisibility(vidView.GONE);
                            mp.start();
                        }
                    });

                }

            });

        }
        @Override
        public boolean dispatchKeyEvent(KeyEvent event) {
            if(String.valueOf(event.getKeyCode())=="4"){
                finish();
                Log.v("key pressed", String.valueOf(event.getKeyCode()));
            }
            return super.dispatchKeyEvent(event);
        }

        @Override
        public void onPause(){
            super.onPause();
            Log.d(TAG, "PAUSE");
            vidView.pause();
            pos=vidView.getCurrentPosition();
            Log.d("POS", String.valueOf(pos));
        }

        @Override
        public void onResume() {
            super.onResume();
            Log.d(TAG, "onResume called");
            vidView.seekTo(pos);
            Log.d("RESUME-POS", String.valueOf(pos));
            vidView.start(); 
        }

    }

然后重新启动sensu-client并解决了问题。