Child pages
  • WHM API 1 Functions - get_cphulk_failed_logins
Skip to end of metadata
Go to start of metadata

Description

This function lists failed login attempt entries from the cPHulk database.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/get_cphulk_failed_logins?api.version=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/get_cphulk_failed_logins?api.version=1
 Command Line
whmapi1 get_cphulk_failed_logins


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command. 

 Output (JSON)
{
  "data": {
    "failed_logins": [
      {
        "exptime": "2014-11-07 00:00:00",
        "timeleft": "14",
        "logintime": "2014-10-20 00:00:00",
        "ip": "192.168.0.1",
        "user": "fry",
        "service": "smtp",
        "authservice": ""
      },
      {
        "exptime": "2014-11-20 00:00:00",
        "timeleft": "14",
        "logintime": "2014-10-20 00:00:00",
        "ip": "192.168.0.2",
        "user": "bender",
        "service": "ftp",
        "authservice": ""
      },
    ]
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "get_cphulk_failed_logins"
  }
}
 Output (XML)
<result><result>
    <data>
        <failed_logins>
            <exptime>2014-11-07 00:00:00</exptime>
            <timeleft>14</timeleft>
            <logintime>2014-10-20 00:00:00</logintime>
            <ip>192.168.0.1</ip>
            <user>fry</user>
            <service>smtp</service>
            <authservice/>
        </failed_logins>
        <failed_logins>
            <exptime>2014-11-20 00:00:00</exptime>
            <timeleft>14</timeleft>
            <logintime>2014-10-20 00:00:00</logintime>
            <ip>192.168.0.2</ip>
            <user>bender</user>
            <service>ftp</service>
            <authservice/>
        </failed_logins>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>get_cphulk_failed_logins</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
failed_loginsarray of hashesAn array of information about each failed login attempt.This array includes the exptime, timeleftlogintime, ip, user, service, and authservice returns. 

exptime

string

The time at which the login request will time out.

The function returns this value in the failed_logins array.

A valid time in YYYY-MM-DD hh:mm:ss format, where:

  • YYYY represents the year.
  • MM represents the month.
  • DD represents the day.
  • hh represents the hour.
  • mm represents the minute.
  • ss represents the second.
2014-12-07 00:00:00

timeleft

integer

The number of minutes that remain before cPHulk removes the block.

The function returns this value in the failed_logins array.

A positive integer that represents a number of minutes.14

logintime 

string

When the login attempt occurred.

The function returns this value in the failed_logins array.

A valid time in YYYY-MM-DD hh:mm:ss format, where:

  • YYYY represents the year.
  • MM represents the month.
  • DD represents the day.
  • hh represents the hour.
  • mm represents the minute.
  • ss represents the second.
2014-11-20 00:00:00

ip

string

The login attempt's IP address.

The function returns this value in the failed_logins array.

A valid IP address.192.168.0.1

user

string

The login attempt's username.

The function returns this value in the failed_logins array.

A valid string.example

service

string

The login attempt's service.

The function returns this value in the failed_logins array.

A valid service name.ftp

authservice

string

The authentication service that the login attempt used.

The function returns this value in the failed_logins array.

A valid authentication service name.null