'Creates a monitoring policy
:param name: Name for the monitoring policy
:rtype: ``str``
:param thresholds: Thresholds for the monitoring policy
:rtype: ``dict``
\'cpu\':{
\'warning\':{
\'value\':90,
\'alert\':false
\'critical\':{
\'value\':95,
\'alert\':false
\'ram\':{
\'warning\':{
\'value\':90,
\'alert\':false
\'critical\':{
\'value\':95,
\'alert\':false
\'disk\':{
\'warning\':{
\'value\':80,
\'alert\':false
\'critical\':{
\'value\':90,
\'alert\':false
\'transfer\':{
\'warning\':{
\'value\':1000,
\'alert\':false
\'critical\':{
\'value\':2000,
\'alert\':false
\'internal_ping\':{
\'warning\':{
\'value\':50,
\'alert\':false
\'critical\':{
\'value\':100,
\'alert\':false
:param ports: Monitoring policies for ports
:rtype: ``dict``
\'protocol\':\'TCP\',
\'port\':\'22\',
\'alert_if\':\'RESPONDING\',
\'email_notification\':true
:param processes: Processes to be monitored
:rtype: ``dict``
\'process\':\'test\',
\'alert_if\':\'NOT_RUNNING\',
\'email_notification\':true
:param description: Description for the monitoring policy
:rtype: ``str``
:param email: Email for notifications
:rtype: ``str``
:param agent: Indicates if agent application will be installed
:rtype: ``boolean``
:return: Newly created instance of monitofing policy
:rtype: ``dict``'

def ex_create_monitoring_policy(self, name, thresholds, ports, processes, description=None, email=None, agent=None):

    body = {'name': name, 'thresholds': thresholds, 'ports': ports, 'processes': processes}
    if (description is not None):
        body['description'] = description
    if (email is not None):
        body['email'] = email
    if (agent is not None):
        body['agent'] = agent
    response = self.connection.request(action='monitoring_policies', data=body, method='POST')
    return response.object
