Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 134111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:33:17+00:00 2026-05-11T06:33:17+00:00

I’d like to parse status.dat file for nagios3 and output as xml with a

  • 0

I’d like to parse status.dat file for nagios3 and output as xml with a python script. The xml part is the easy one but how do I go about parsing the file? Use multi line regex? It’s possible the file will be large as many hosts and services are monitored, will loading the whole file in memory be wise?
I only need to extract services that have critical state and host they belong to.

Any help and pointing in the right direction will be highly appreciated.

LE Here’s how the file looks:

######################################## #          NAGIOS STATUS FILE # # THIS FILE IS AUTOMATICALLY GENERATED # BY NAGIOS.  DO NOT MODIFY THIS FILE! ########################################  info {     created=1233491098     version=2.11     }  program {     modified_host_attributes=0     modified_service_attributes=0     nagios_pid=15015     daemon_mode=1     program_start=1233490393     last_command_check=0     last_log_rotation=0     enable_notifications=1     active_service_checks_enabled=1     passive_service_checks_enabled=1     active_host_checks_enabled=1     passive_host_checks_enabled=1     enable_event_handlers=1     obsess_over_services=0     obsess_over_hosts=0     check_service_freshness=1     check_host_freshness=0     enable_flap_detection=0     enable_failure_prediction=1     process_performance_data=0     global_host_event_handler=     global_service_event_handler=     total_external_command_buffer_slots=4096     used_external_command_buffer_slots=0     high_external_command_buffer_slots=0     total_check_result_buffer_slots=4096     used_check_result_buffer_slots=0     high_check_result_buffer_slots=2     }  host {     host_name=localhost     modified_attributes=0     check_command=check-host-alive     event_handler=     has_been_checked=1     should_be_scheduled=0     check_execution_time=0.019     check_latency=0.000     check_type=0     current_state=0     last_hard_state=0     plugin_output=PING OK - Packet loss = 0%, RTA = 3.57 ms     performance_data=     last_check=1233490883     next_check=0     current_attempt=1     max_attempts=10     state_type=1     last_state_change=1233489475     last_hard_state_change=1233489475     last_time_up=1233490883     last_time_down=0     last_time_unreachable=0     last_notification=0     next_notification=0     no_more_notifications=0     current_notification_number=0     notifications_enabled=1     problem_has_been_acknowledged=0     acknowledgement_type=0     active_checks_enabled=1     passive_checks_enabled=1     event_handler_enabled=1     flap_detection_enabled=1     failure_prediction_enabled=1     process_performance_data=1     obsess_over_host=1     last_update=1233491098     is_flapping=0     percent_state_change=0.00     scheduled_downtime_depth=0     }  service {     host_name=gateway     service_description=PING     modified_attributes=0     check_command=check_ping!100.0,20%!500.0,60%     event_handler=     has_been_checked=1     should_be_scheduled=1     check_execution_time=4.017     check_latency=0.210     check_type=0     current_state=0     last_hard_state=0     current_attempt=1     max_attempts=4     state_type=1     last_state_change=1233489432     last_hard_state_change=1233489432     last_time_ok=1233491078     last_time_warning=0     last_time_unknown=0     last_time_critical=0     plugin_output=PING OK - Packet loss = 0%, RTA = 2.98 ms     performance_data=     last_check=1233491078     next_check=1233491378     current_notification_number=0     last_notification=0     next_notification=0     no_more_notifications=0     notifications_enabled=1     active_checks_enabled=1     passive_checks_enabled=1     event_handler_enabled=1     problem_has_been_acknowledged=0     acknowledgement_type=0     flap_detection_enabled=1     failure_prediction_enabled=1     process_performance_data=1     obsess_over_service=1     last_update=1233491098     is_flapping=0     percent_state_change=0.00     scheduled_downtime_depth=0     } 

It can have any number of hosts and a host can have any number of services.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T06:33:17+00:00Added an answer on May 11, 2026 at 6:33 am

    Nagiosity does exactly what you want:

    http://code.google.com/p/nagiosity/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 299k
  • Answers 299k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I had exactly the same problem when I first went… May 13, 2026 at 7:49 pm
  • Editorial Team
    Editorial Team added an answer I have to admit I'm not an expert in NHibernate,… May 13, 2026 at 7:49 pm
  • Editorial Team
    Editorial Team added an answer Sounds like the new machine has an updated version of… May 13, 2026 at 7:49 pm

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.