Description

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

Examples 


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

{
  "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"
  }
}
<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>

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