Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[training#2] add ipmi powerStatus poller and status alert job #3

Open
wants to merge 1 commit into
base: sample_master
Choose a base branch
from

Conversation

iceiilin
Copy link
Owner

@iceiilin iceiilin commented Sep 4, 2017

Background

Training#2-1: add ipmi powerStatus poller.

Implementation:

add powerStatus poller callback in ipmi-job and corresponding item in message-cache

Result:

After posting powerStatus poller using the following command:

 curl -X POST -H 'Content-Type: application/json' -d '{"type":"ipmi","pollInterval":10000,"node":"59ad08886cea19993a4c7a77", "config":{"command":"powerStatus"}}' localhost:8080/api/2.0/pollers

The powerStatus poller data is shown as below:

curl localhost:8080/api/2.0/pollers/59ad13a5a8455cbf3eafd5f9/data/current | python -mjson.tool
[
    {
        "host": "172.31.128.21",
        "node": "59ad08886cea19993a4c7a77",
        "powerStatus": {
            "status": "OFF"
        },
        "timestamp": "Mon Sep 04 2017 09:01:21 GMT+0000 (UTC)",
        "user": "admin"
    }
]

After powering on the node, and wait for 10s,

ipmitool -I lanplus -U admin -P admin -H 172.31.128.21 chassis power on

The poller data is

[
    {
        "host": "172.31.128.21",
        "node": "59ad08886cea19993a4c7a77",
        "powerStatus": {
            "status": "ON"
        },
        "timestamp": "Mon Sep 04 2017 09:17:29 GMT+0000 (UTC)",
        "user": "admin"
    }
]

@iceiilin iceiilin changed the title [training#2-1] add ipmi powerStatus poller [training#2] add ipmi powerStatus poller and status alert job Sep 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant